From a64c7ab8359ba40f86a04808ce29310fb332f088 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Thu, 23 Sep 2021 19:59:08 +0200 Subject: Use a correct serial for xdg_surface.ack_configure Previous pendingConfigureSerial can be overwritten regardless of the current configuration. With this patch, the client surface can use correct serial for xdg_surface.ack_configure. Fixes: QTBUG-95962 Change-Id: I849d2daf4acc8ef6e7f8528af9c5a57f671f43e6 Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 07ddfbfa43d08c2b76aabafaab38830e04a42690) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 9 +++++---- src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 365a6c4ed..9d419a901 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -335,15 +335,16 @@ bool QWaylandXdgSurface::handleExpose(const QRegion ®ion) void QWaylandXdgSurface::applyConfigure() { - Q_ASSERT(m_pendingConfigureSerial != 0); + // It is a redundant ack_configure, so skipped. + if (m_pendingConfigureSerial == m_appliedConfigureSerial) + return; if (m_toplevel) m_toplevel->applyConfigure(); + m_appliedConfigureSerial = m_pendingConfigureSerial; m_configured = true; - ack_configure(m_pendingConfigureSerial); - - m_pendingConfigureSerial = 0; + ack_configure(m_appliedConfigureSerial); } bool QWaylandXdgSurface::wantsDecorations() const diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h index c1450ee3c..1e3e8ec10 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -153,6 +153,7 @@ private: bool m_configured = false; QRegion m_exposeRegion; uint m_pendingConfigureSerial = 0; + uint m_appliedConfigureSerial = 0; friend class QWaylandXdgShell; }; -- cgit v1.2.3