Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.9, 6.6.1
Description
During "QXcbWindow::create", the "_NET_WM_STATE" property is changed a first time, and a second time within "QXcbWindow::show", right before finally mapping the window.
In "create", the change is attempted by means of sending a client message
(create->setWindowFlags->setNetWmState->xcb_send_event).
In "show", the change is conducted by means of an "xcb_change_property" XServer request
(show->setNetWmStateOnUnmappedWindow->xcb_change_property).
The create-path by design can only raise a subset of the states which are eventually raised in the show-path.
However, the second change may overtake the first one, since "xcb_change_property" is processed by the XServer directly, while the client message takes a detour through the window manager.
In case of overtaking, the window manager (applying the subset of states) may or may not destroy the larger set of states specified in setNetWmStateOnUnmappedWindow.
If for example the window is a modal dialog, then the _NET_WM_STATE_MODAL state will only be communicated in the show-path.
If overtaking is very fast, then the window manager will see the already stored _NET_WM_STATE_MODAL and leave it alone (the client message only adds/removes/toggles certain other states).
If overtaking is medium fast, then _NET_WM_STATE_MODAL may not yet be stored by the time the window manager checks the current states, but may be stored by the time the window manager writes the modifications back. Then _NET_WM_STATE_MODAL will be lost.
The best way to avoid this race seems to be not to mix protocols.
Either only use two calls to "xcb_change_property" or two client messages, but not both.
On the other hand it seems as if the create-path of specifing an early set of _NET_WM_STATE is superfluous, since the show-path will apply a superset of states anyway.
Looks like due to this x11vkbwrapper some time does not shows up even when it is called it via dbus and atspi libraries with showKeyboard , and following error comes up.
x11vkbwrapper[4163]: qt.qpa.xcb: internal error: void QXcbWindow::setNetWmStateOnUnmappedWindow() called on mapped window
Attachments
Issue Links
- relates to
-
QTBUG-82059 QWindowPrivate::setVisible does not appropriately handle recursive calls to itself
- Reported