I currently use ctrl+w for closing application windows. ctrl+w is also Firefox's shortcut for closing a tab.
Is it possible to keep both, so therefore ignoring the global shortcut for ctrl+w when Firefox is focused?
I regularly have this sort of problem with keyboard shortcut clashes with at least one program, so any solution to get an application to ignore a shortcut is highly valuable.
32 Answers
It is often possible to set shortcuts within applications for e.g. close window. For example, for closing a terminal window like a firefox tab, try opening a terminal and right-clicking for Preferences, then Shortcuts, and setting Close Window to ctrl-w.
Then you can globally set close window in Ubuntu to something else (like ctrl-q), and Firefox can use ctrl-w for closing tabs.
go to about:config in firefox, and set browser.tabs.closeWindowWithLastTab to false
that will make ctrl+w to close the last tab but keep browser open.