If QWidget has child-widgets like QDialogs or floating QDockWidgets,
those secondary Widgets refer to their parent on X Window-Level via X-property "WM_TRANSIENT_FOR". If the parent switches the winId, the new value is currently not written to the secondary's X-property. The secondary continues to refer to a stale window ID, unless it receives a subsequent replacement of its X11 window as well.
This stale window ID produces a mess for Window Managers, which in general make functional use of the ID which is stored in "WM_TRANSIENT_FOR".
- To reproduce the issue, please run the attached example project.
- Switch to "Type Dialog" and check "Window stays on top"
- This switches BOTH the preview and the control window to "stays on top". The consequence of this change for the control window is to receive another window.
- Run the command line utility "xprop" and click on the "Preview" window.
Note the ID which is reported for "WM_TRANSIENT_FOR"
- Run the command line utility "xwininfo" and click on the "Window Flags" window.
Note the ID which is reported. It differs from the WM_TRANSIENT_FOR value, but should be the same.
If you repeat the test without checking "window stays on top", then both IDs are identical.