From ce176682bcea43b7ffaa14d14062b5a2b4fe8891 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 15 Jul 2024 12:59:51 +0100 Subject: [PATCH] Client: Add test that we always respond to configure events Change-Id: I35ca2bb3287efa4c79f1352ebc7f5da872b2d4ce Reviewed-by: Vlad Zahorodnii --- tests/auto/wayland/xdgshell/tst_xdgshell.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp index 1dc57e28050..a14f103219c 100644 --- a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp @@ -111,11 +111,30 @@ void tst_xdgshell::configureSize() const QSize configureSize(60, 40); + int pendingSerial; exec([&] { xdgToplevel()->sendCompleteConfigure(configureSize); + pendingSerial = xdgSurface()->m_pendingConfigureSerials.last(); }); QTRY_COMPARE(configureSpy.size(), 1); + QCOMPARE(configureSpy.last()[0].toInt(), pendingSerial); + + exec([&] { + Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer; + QVERIFY(buffer); + QCOMPARE(buffer->size(), configureSize); + }); + + // clients should always respond with a new ack configure + commit + // even if nothing changed + exec([&] { + xdgToplevel()->sendCompleteConfigure(configureSize); + pendingSerial = xdgSurface()->m_pendingConfigureSerials.last(); + }); + + QTRY_COMPARE(configureSpy.size(), 2); + QCOMPARE(configureSpy.last()[0].toInt(), pendingSerial); exec([&] { Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer;