diff options
Diffstat (limited to 'tests/auto/client/xdgshellv6/tst_xdgshellv6.cpp')
-rw-r--r-- | tests/auto/client/xdgshellv6/tst_xdgshellv6.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/client/xdgshellv6/tst_xdgshellv6.cpp b/tests/auto/client/xdgshellv6/tst_xdgshellv6.cpp index 3fd8153e6..3c822325b 100644 --- a/tests/auto/client/xdgshellv6/tst_xdgshellv6.cpp +++ b/tests/auto/client/xdgshellv6/tst_xdgshellv6.cpp @@ -58,6 +58,14 @@ public: return QWindow::event(event); } + void exposeEvent(QExposeEvent *event) override + { + ++exposeEventCount; + QWindow::exposeEvent(event); + } + + int exposeEventCount = 0; + signals: void windowStateChangeEventReceived(uint oldState); }; @@ -102,6 +110,7 @@ private slots: void windowGeometrySimple(); void windowGeometryFixed(); void flushUnconfiguredXdgSurface(); + void dontSpamExposeEvents(); private: MockCompositor *m_compositor = nullptr; @@ -395,6 +404,20 @@ void tst_WaylandClientXdgShellV6::flushUnconfiguredXdgSurface() QVERIFY(window.isExposed()); } +void tst_WaylandClientXdgShellV6::dontSpamExposeEvents() +{ + TestWindow window; + window.show(); + + QSharedPointer<MockSurface> surface; + QTRY_VERIFY(surface = m_compositor->surface()); + QTRY_VERIFY(window.exposeEventCount == 0); + + m_compositor->sendShellSurfaceConfigure(surface); + QTRY_VERIFY(window.isExposed()); + QTRY_VERIFY(window.exposeEventCount == 1); +} + int main(int argc, char **argv) { setenv("XDG_RUNTIME_DIR", ".", 1); |