summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2025-05-30 11:20:23 +0300
committerDavid Edmundson <[email protected]>2025-06-02 20:18:03 +0300
commit602fa3f3370690f6d197dfe37e57aa3648ea751b (patch)
tree8134162474020653579d869e829155ec9efc1dcf
parentca27a661bdbaa120eb3645afb98c3efda9dc96c7 (diff)
wayland: Ack configure events when suspended
All configure events should be acked, and that acknowledgement is double buffered with the surface commit. If a window is not exposed, for example being in a suspended state, us sending an expose event is semantically wrong. It also ends up not resulting in a commit as at some point it no-ops, we have to commit manually. Change-Id: I020b06f04030c1209f2fc768adc8bd66d57975b1 Reviewed-by: David Redondo <[email protected]>
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp7
-rw-r--r--tests/auto/wayland/xdgshell/tst_xdgshell.cpp11
2 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index 5b0f2b15f82..f40496d0e30 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -725,8 +725,11 @@ void QWaylandWindow::applyConfigure()
mShellSurface->applyConfigure();
mWaitingToApplyConfigure = false;
- QRect exposeGeometry(QPoint(), geometry().size());
- sendExposeEvent(exposeGeometry);
+ if (mExposed)
+ sendExposeEvent(QRect(QPoint(), geometry().size()));
+ else
+ // we still need to commit the configured ack for a hidden surface
+ commit();
}
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
diff --git a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp
index 3a7e001e1d9..72200ce72b6 100644
--- a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp
+++ b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp
@@ -845,15 +845,18 @@ void tst_xdgshell::suspended()
QVERIFY(!window.isExposed()); // not exposed until we're configured
QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
- exec([&] { xdgToplevel()->sendCompleteConfigure(); });
- QCOMPOSITOR_TRY_VERIFY(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial);
+ uint serial = 0;
+ exec([&] { serial = xdgToplevel()->sendCompleteConfigure(); });
QTRY_VERIFY(window.isExposed());
+ QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial, serial);
- exec([&] { xdgToplevel()->sendCompleteConfigure(QSize(), {XdgToplevel::state_suspended}); });
+ exec([&] { serial = xdgToplevel()->sendCompleteConfigure(QSize(), {XdgToplevel::state_suspended}); });
QTRY_VERIFY(!window.isExposed());
+ QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial, serial);
- exec([&] { xdgToplevel()->sendCompleteConfigure(QSize(), {}); });
+ exec([&] { serial = xdgToplevel()->sendCompleteConfigure(QSize(), {}); });
QTRY_VERIFY(window.isExposed());
+ QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial, serial);
}
void tst_xdgshell::initiallySuspended()