diff options
author | Pier Luigi Fiorini <pierluigi.fiorini@liri.io> | 2019-01-18 15:06:56 +0100 |
---|---|---|
committer | Pier Luigi Fiorini <pierluigi.fiorini@liri.io> | 2019-08-15 09:08:24 +0200 |
commit | ed79c14c48501cb9d2ed922da78843f06ba208f0 (patch) | |
tree | a8fc19350b0c46655f6a580a9b9d927efd11f640 /tests/auto | |
parent | be244d9dde8b13b4c413b1683e0c9940446b05a6 (diff) |
Test the exact window size
Make sure we test exactly the size we expect.
We used frameGeometry() to take client-side decoration margins into
account, but actually frameMargins() returns exactly that, this
means we can compute the actual size that we want to test.
Change-Id: I2f41ffdb2aa2e3a4253a1ff7038c4bc2e43cdf98
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/client/xdgshell/tst_xdgshell.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index 038ff6624..c887e5d44 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -476,10 +476,14 @@ void tst_xdgshell::windowGeometry() exec([=] { xdgToplevel()->sendCompleteConfigure(); }); - QCOMPOSITOR_TRY_COMPARE(xdgSurface()->m_committed.windowGeometry, QRect(QPoint(0, 0), window.frameGeometry().size())); + QSize marginsSize; + marginsSize.setWidth(window.frameMargins().left() + window.frameMargins().right()); + marginsSize.setHeight(window.frameMargins().top() + window.frameMargins().bottom()); + + QCOMPOSITOR_TRY_COMPARE(xdgSurface()->m_committed.windowGeometry, QRect(QPoint(0, 0), QSize(400, 320) + marginsSize)); window.resize(800, 600); - QCOMPOSITOR_TRY_COMPARE(xdgSurface()->m_committed.windowGeometry, QRect(QPoint(0, 0), window.frameGeometry().size())); + QCOMPOSITOR_TRY_COMPARE(xdgSurface()->m_committed.windowGeometry, QRect(QPoint(0, 0), QSize(800, 600) + marginsSize)); } void tst_xdgshell::foreignSurface() |