! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Absolute focus stealing prevention mode


Description William Ewing 2011-08-17 20:10:49 CEST
It would be nice to in addition to the current focus stealing prevention, if there were a mode in which no application could ever steal focus for any reason.
Comment 1 Olivier Fourdan editbugs 2011-08-17 21:08:11 CEST
Given how focus management is done in X, I am not sure this is even doable (at least, reliably).

There's no "FocusRequest" (like you have a MapRequest for example) mechanism that the window manager could reliably intercept, all the WM gets is FocusIn and FocusOut events (ie it's notified *after* focus was changed), and nothing can really prevent an application from doing an XSetInputFocus [1]. it's even expected when using the "take focus" mechanism as defined in ICCCM [2], the WM relies on the applications to do the focus themselves (via a client message).

That said, if you have patches to improve the current state of focus management in xfwm4, I'll gladly consider them :-) But that code in xfwm4 is quite complex (given the different modes of focus available, the different mechanisms possible) and touchy (ie most of the times, changes there introduce regressions and rarely any improvement).

[1] http://tronche.com/gui/x/xlib/input/XSetInputFocus.html
[2] http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7
Comment 2 Olivier Fourdan editbugs 2011-09-12 09:21:33 CEST
So, in a nutshell, the best I can come up with is:

1. Set "do not focus window automatically " in xfwm4 settings
2. Enable focus stealing prevention in xfwm4-tweaks settings

Bug #7903

Reported by:
William Ewing
Reported on: 2011-08-17
Last modified on: 2020-05-21


Olivier Fourdan
CC List:
1 user




Additional information