I have Opera set as my default browser but it is the same for Firefox. When opening a link in Liferea, the link opens in an external browser and the browser gets focus. I would like to open the links in background (so that the browser does not get focus).
The only solution is to set Focus prevention level to Normal in the Focus & Raise Behaviour tab of General options in CCSM. But this messes things for other things. DO you have any other idea how to prevent new windows to have focus?
I am using Unity on 11.10.
I think this is a bug, so I reported it. This used to work with Gnome 2, it works with Gnome Shell and Gnome 3 fallback. I suspect compiz, but what do I know.
Right-click on the window title bar of Liferea and choose "Always on Top". Now all your links will open in the background.
Open CompizConfig Settings manager(CCSM) from dash
Under General Options,
set Auto-raise=Very high
and Delay=500.
All new windows will open in the background!
Alone the CCSM auto-raise wont work here in ubuntu 10.04 or 12.04.. so I had to create this script:
Be advised that this simple script will work for all windows, not only your browsers. But it is overall good in a sense that you wont for ex. miss click on new opened windows...
This script depends on you setting the "Focus prevention level" high enough so that new opened windows wont get the focus. It works on Ubuntu 10.04 and 12.04 at least, but should work anywhere... if it fails for you, say so and we can think together!
This is an endless loop (break it with ctrl+c) that will "activate" the window that has focus (focus for keyboard input). So it will make the focused window "jump" to foreground each 0.5 seconds (you can lower or up the delay value to your needs/taste).
So all new opened applications and windows will still open in the foreground but will be promptly hidden by the window that has focus!
Just to make it clear, they will not open in the background but this script will provide almost the same effect. "Almost" because if you are very unlucky you can still click on the new opened window before the focused one be put to foreground, what will make the new window be the focused one... Lowering the delay will help prevent that but consume more cpu, I think less than 0.1 is not good, but you must test to see what works better for you...
PS.: your xdotool version must support these commands: getwindowfocus, getwindowname, windowactivate