From eef9f34e58465458420f6e1295bdce4a59702c54 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sun, 13 Jan 2019 23:28:06 +0100 Subject: Client: Test for xdg surface window geometry Change-Id: I2f336a81682317b1f7dc939d911906b4db60a386 Reviewed-by: Johan Helsing --- tests/auto/client/xdgshell/tst_xdgshell.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/auto/client/xdgshell') diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index 1bfabe55f..de0341014 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -44,6 +44,7 @@ private slots: void popup(); void pongs(); void minMaxSize(); + void windowGeometry(); }; void tst_xdgshell::showMinimized() @@ -287,5 +288,20 @@ void tst_xdgshell::minMaxSize() QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(50, 40)); } +void tst_xdgshell::windowGeometry() +{ + QRasterWindow window; + window.resize(400, 320); + window.show(); + QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); + + exec([=] { xdgToplevel()->sendCompleteConfigure(); }); + + QCOMPOSITOR_TRY_COMPARE(xdgSurface()->m_committed.windowGeometry, QRect(QPoint(0, 0), window.frameGeometry().size())); + + window.resize(800, 600); + QCOMPOSITOR_TRY_COMPARE(xdgSurface()->m_committed.windowGeometry, QRect(QPoint(0, 0), window.frameGeometry().size())); +} + QCOMPOSITOR_TEST_MAIN(tst_xdgshell) #include "tst_xdgshell.moc" -- cgit v1.2.3