how to prevent new windows from stealing focus in gnome

My best solution for this so far is to install Compiz and within it take the following actions: select "General Options" from the top of the first window, open the "Focus & Raise Behaviour" tab, select "Very High" from the "Focus Prevention Level" dropdown, and enter "any" in the "Focus Prevention Windows" text box.

I'm getting used to the fact that I need to visually scan the applications at the bottom of the window on a regular basis and it produces some odd behaviors such as applications which previously had focus but then yield it to other applications after a dialog has been completed.

Still looking for better solutions for this, and I expect that I could get better behavior by tweaking the settings in Compiz, but I'm too busy for this.


It's funny that I found the solution for my Ubuntu and GNOME on OpenSolaris FAQ:

The solution is to start:

gconftool-2 -s -t string /apps/metacity/general/focus_new_windows "strict"

or, alternatively you can start gconf-editor and fix /apps/metacity/general/focus_new_windows to "strict"


That didn't work for me in Ubuntu 16.04. Nor did adjusting Desktop>wm>preferences>auto-raise via the dconf Editor.

What does work is making sure you have the compizconfig-settings-manager installed. Then (I don't know of a way to reach that advanced utility via the UI), you can run the command from a Terminal: ccsm

Then you click on the General options and in there, click on the Focus & Raise Behaviour tab. You need to change the Focus Prevention Level from Low to Normal (at least).

(Workrave started driving me mad when something recently changed and it started stealing focus while I was writing and not looking at the screen!)

Tags:

Linux

Gnome

Focus