From 0de4b326d8e02c228ebefcac1abe069c45cbb5c4 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Mon, 26 Nov 2018 15:23:27 +0100 Subject: 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 --- src/plugins/platforms/xcb/qxcbwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 891fe6b155..65e1c71531 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -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(); -- cgit v1.2.3