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()