summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.h
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-06-25 10:32:07 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2018-06-26 07:11:34 +0000
commit4050ee6ac7da0e5e7414c699c3cd4e26193c653d (patch)
tree68d6110d1fadc30c2e2d3227ff99254f7881d623 /src/plugins/platforms/xcb/qxcbwindow.h
parent0e2dae902b316a40a1d861198da55118d2155964 (diff)
xcb: rely on WM_SIZE_HINTS gravity to handle x,y positioning
The original code was added by b316c3ac5e4acac75505bfd77677cecc181599a (in 2012). This patch changes two things: 1) We now rely on WM to position a window based on the set gravity. It should not be necessary to calculate coordinates manually as was done in windowToWmGeometry(). We don't even know the decoration size before the window is mapped. 2) We now update gravity whenever needed instead of hardcoding based on what Qt APIs (setGeometry vs setFramePosition) where used to set the initial window position. The patch from b316c3a says: "Determine gravity from initial position. Do not change later as it will cause the window to move uncontrollably" Since it did not elaborate on the situation, we can only assume that it was caused by another bug in Qt at the time or perhaps a broken WM. From [1]: "Applications are free to change their win_gravity setting at any time. If an Application changes its win_gravity then the Window Manager should adjust the reference point, so that the client window will not move as the result." Tested on Ubuntu/Unity, KDE/KWin, Gnome-shell/Mutter, Lubuntu/OpenBox. Works as expected everywhere expect Unity. Unity seems to ignore XCB_GRAVITY_STATIC and treats it as XCB_GRAVITY_NORTH_WEST, which means that setGeometry/setFramePosition produce the same placement on this WM (the behavior was the same also before this patch). P.S. Also renamed xRect -> rect, which was a leftover from ae5f2a66720a4bb22c120bd7d1564652cac00367 With this change we can un-blacklist QWidget save/restore geometry auto tests. [1] https://specifications.freedesktop.org/wm-spec/latest/ar01s09.html Task-number: QTBUG-66708 Change-Id: I381eef5d34dddb04de16a897ce5540b9c430b216 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index b44ba77a6b..d75f22bb51 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -253,8 +253,6 @@ protected:
Qt::WindowStates m_windowState = Qt::WindowNoState;
- xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC;
-
bool m_mapped = false;
bool m_transparent = false;
bool m_usingSyncProtocol = false;