You are not logged in.

#1 2010-01-05 20:11:30

SardarNL
Member
Registered: 2008-11-22
Posts: 10

Prevent focus stealing in Gnome

Greetings,

Metacity and Openbox give the focus to any application that is requesting it. These are Openoffice and NetBeans. It looks like you are in the middle of fast typing in another window while one of these apps is starting, suddenly the app's window becomes in focus and all keystrokes go to that app. It is very annoying and dangerous, since any popup will be immediately accepted (on default action) when I press space button.

I don't know how to disable and I don't want to disable focus requests in these apps individually. Is it possible to prevent any application from stealing focus? I don't have any sensitive application installed. There is nothing critical that requires my attention. Never. The best solution is to allow the app. flashing in the taskbar, but if this is not possible, then at least prevent it taking the focus.

Tried openbox - same shit happens there too.

P.S. why do we ever need applications that bring them self in focus without user interaction? some medical app.? used by 0.0000...1% of users... maybe... otherwise the feature is f*cking annoying.

Offline

#2 2010-01-06 19:11:11

SardarNL
Member
Registered: 2008-11-22
Posts: 10

Re: Prevent focus stealing in Gnome

This topic should probably be moved to "Desktop Environments" forum.

Compiz has some kind of focus stealing prevention, but even in "Very strict" mode for "any" window it allows popping the programs up, also makes normal navigation very tricky, you have to click on program button from taskbar and click again in opened window in order to give it focus -- useless.

The best behavior is in Windows Vista, you can click on icons in panel and the program will get the focus. If you are in another window, then the program will simply flash in taskbar. Full control. Secure. This is one of the strongest points of Windows system, sad that it sucks in other aspects.

Offline

#3 2010-01-06 20:20:05

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Prevent focus stealing in Gnome

I'm running Openbox as a stand-alone WM with no DE.

In Openbox's rc.xml, probably near the beginning of your copy of the file, there is a section dealing with window focus.

<focus>
   <focusNew>yes</focusNew>
   <!-- always try to focus new windows when they appear. other rules do
       apply -->
   ...
</focus>

Changing the yes to a no in the '<focusNew>' line appears to stop focus stealing.  I've just changed it on my box, and with only a few tests, it hasn't failed.

Offline

#4 2010-01-06 21:21:26

SardarNL
Member
Registered: 2008-11-22
Posts: 10

Re: Prevent focus stealing in Gnome

Yes, is does what is says: do not give focus to new windows. If you start, for example, a terminal, then it will not become in focus unless you explicitly click in window (usability problem, but I can live with it). However it does not prevent focus stealing, any app can bring itself in focus at any time without my interaction. Steps to reproduce the problem:

  • Set <focusNew>no</focusNew>

  • Start any slow app. that requests focus when it is initialized (eg. NetBeans, OpenOffice, Matlab etc.)

  • Before the app. is fully started, switch to your browser window -> Quick post -> textarea (right under in this page).

  • Type any text for 3-10 seconds while the app in step 2 was starting. At some point the app will be initialized and will bring itself into focus forcefully, so everything you type will be sent to that app (remember, you was typing into a webrowser -> textarea).

  • Enjoy Matlab bitching over unknown command "rea)."  OpenOffice starting automatic recovery because you hit space accepting default "Yes, start recovery". Netbeans shutting down because you hit ctrl+w to close current tab in Firefox.

Focus stealing is annoying by itself. No application has a right to bring itself in focus, except: if it is a child window of the app currently being in focus or if that app was started by the app currently in focus. In all other cases the window must stay minimized even if it is an system prompt asking for password (OK, system messages are tolerable... but not OpenOffice/Matlab or any other crappy app =\ ).

Offline

#5 2010-01-07 01:12:43

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Prevent focus stealing in Gnome

It works when focus follows the mouse (<followMouse>yes</followMouse>).  It fails when this option isn't set.  That's why my tests showed it working with OpenOffice.

You may find using focus following the mouse just as annoying as apps stealing focus when they should not.

Offline

Board footer

Powered by FluxBB