xcb: fix issue with dialogs hidden by other windows

This was a regression from Qt4, due to not setting the window
group leader in WM_HINTS property. Qt4 did set this property.

It was not obvious that something was missing because of the
similarly named WM_CLIENT_LEADER property, which we do set.
Testing revealed that setting WM_CLIENT_LEADER is sufficient
on some DEs, e.g. KDE, Unity, but did not have the desired
effect on e.g Gnome and XFCE.

EWMH/ICCCM specs are known to be ambiguous, WM_CLIENT_LEADER
is only mentioned in the section on the session management, so
it is not surprising that there is this inconsistency between
various WMs.

This patch merely restores a lost WM hint. This solves the
reported issues on major desktops. If we support calling show()
on a dialog before its parent has been shown is still an open
question, which should be handled in QTBUG-72040.

Task-number: QTBUG-56829
Fixes: QTBUG-46626
Fixes: QTBUG-70756
Task-number: QTBUG-72040
Change-Id: Id2c575850e5f4f5af3e57963c577d33572e30b6e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
bb10
Gatis Paeglis 2018-11-26 15:23:27 +01:00
parent e11a3b3f3e
commit 0de4b326d8
1 changed files with 2 additions and 0 deletions

View File

@ -501,6 +501,8 @@ void QXcbWindow::create()
// from various setter functions for adjusting the hints.
xcb_wm_hints_t hints;
memset(&hints, 0, sizeof(hints));
hints.flags = XCB_ICCCM_WM_HINT_WINDOW_GROUP;
hints.window_group = connection()->clientLeader();
xcb_set_wm_hints(xcb_connection(), m_window, &hints);
xcb_window_t leader = connection()->clientLeader();