Bored of programs stealing focus ?
For instance, you launch an application which takes time to start, you switch to something else to work, and after some time the main window of your just launched program pops up and steals focus (including keyboad ...).
This article gives instructions to change this behavior both under
KDE and Gnome.
Under KDE:
- open 'System Settings' application
- open 'Window Behavior' menu
- select 'Window Behavior' left panel
- select 'Focus' right panel
- update 'Focus stealing prevention level' and policy to your needs
Under Gnome:
- check 'focus new windows' configuration (it is defined to 'smart' by default):
gconftool-2 --get /apps/metacity/general/focus_new_windows
- change 'focus new windows' from 'smart' to 'strict':
gconftool-2 --set /apps/metacity/general/focus_new_windows --type string strict
Under Gnome-Shell:
In addition to previous instructions for Gnome, which don't seem enough for Gnome-Shell (Gnome 3), you can:
- check 'no focus windows' configuration (empty by default):
gconftool-2 --get /apps/metacity/general/no_focus_windows
- change 'no focus windows' to fully disable focus for ANY windows:
gconftool-2 --set /apps/metacity/general/no_focus_windows --type string "(not true)"
You won't be annoyed anymore by windows stealing focus.
For instance, you launch an application which takes time to start, you switch to something else to work, and after some time the main window of your just launched program pops up and steals focus (including keyboad ...).
This article gives instructions to change this behavior both under
KDE and Gnome.
Under KDE:
- open 'System Settings' application
- open 'Window Behavior' menu
- select 'Window Behavior' left panel
- select 'Focus' right panel
- update 'Focus stealing prevention level' and policy to your needs
Under Gnome:
- check 'focus new windows' configuration (it is defined to 'smart' by default):
gconftool-2 --get /apps/metacity/general/focus_new_windows
- change 'focus new windows' from 'smart' to 'strict':
gconftool-2 --set /apps/metacity/general/focus_new_windows --type string strict
Under Gnome-Shell:
In addition to previous instructions for Gnome, which don't seem enough for Gnome-Shell (Gnome 3), you can:
- check 'no focus windows' configuration (empty by default):
gconftool-2 --get /apps/metacity/general/no_focus_windows
- change 'no focus windows' to fully disable focus for ANY windows:
gconftool-2 --set /apps/metacity/general/no_focus_windows --type string "(not true)"
You won't be annoyed anymore by windows stealing focus.
Damn, this was useful! Thanks a bunch!
ReplyDeleteIt fixed my Unity that kept losing focus on changing windows. Thanks a lot!!
ReplyDeletethanks! I wonder if there exists a GUI for these advanced options. In openSuse 11 gnome-control-center do not let me do this kind of advanced stuff.
ReplyDeleteNo joy unless you're using Metacity. A big problem for Ubuntu-proper users.
ReplyDeleteOMG! Yes! Thank you!
ReplyDeleteI'm afraid the Gnome-shell (Gnome 3) option does not work, as there is no no_focus_windows key.
ReplyDeleteIn Gnome-shell, the new corresponding property is 'org.gnome.desktop.wm.preferences.focus-new-windows'.
ReplyDeleteYou can edit it with gsettings.
In Cinnamon 2.2.14 the following worked for me 'gsettings set org.cinnamon.desktop.wm.preferences focus-new-windows strict'
ReplyDelete