Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8
Description
QtXCB unconditionally adds WM_TAKE_FOCUS to the WM_PROTOCOLS property of windows. This means that the client will use either Locally Active or Globally Active input model as described in https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7.
This means that if the window has Qt::WindowDoesNotAcceptFocus, the window manager will still try to activate the window. If there's no transient to forward input focus to, it will look as if the input focus goes to void.
In some clients like plasmashell, that's undesired, we don't want the window manager even consider such clients as potential candidates for window activation. But since WM_TAKE_FOCUS is listed in the WM_PROTOCOLS and Qt calling xcb_icccm_wm_hints_set_input(&hints, false), it's not guaranteed.
https://github.com/freedesktop-unofficial-mirror/xcb__util-wm/blob/master/icccm/xcb_icccm.h#L828
https://tronche.com/gui/x/xlib/ICC/client-to-window-manager/wm-hints.html
It would be great if QtXCB provided a way to opt out of the WM_TAKE_FOCUS protocol. For example by providing an api in the native interface, e.g. void QX11Window::setTakesFocus(bool), or updating the WM_PROTOCOLS property in response to setting or unsetting Qt::WindowDoesNotAcceptFocus flag, although I'm not sure that the protocols property can be changed once the window is in the mapped state.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-121930 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
537263,1 | WIP: xcb: follow Qt::WindowDoesNotAcceptFocus when setting WM_TAKE_FOCUS | dev | qt/qtbase | Status: NEW | -2 | 0 |