Blame SOURCES/0012-Client-Set-XdgShell-size-hints-before-the-first-comm.patch

f38a11
From d9d7c73f908db351921cf016c5e079f3d13e84aa Mon Sep 17 00:00:00 2001
b814f0
From: David Edmundson <davidedmundson@kde.org>
b814f0
Date: Mon, 3 May 2021 23:01:53 +0100
f38a11
Subject: [PATCH 12/40] Client: Set XdgShell size hints before the first commit
b814f0
b814f0
propagateSizeHints is only called in QWindow we have platform window and
b814f0
minimumSizeHint is then sent. We also need to send existing hints when
b814f0
we create the shell window.
b814f0
b814f0
Sending them when we apply configure is too late, we need these hints
b814f0
available for the compositor to correctly configure the window.
b814f0
b814f0
Change-Id: I6cbb294b11db06ecd87535fa4816bb8ad34a29c6
b814f0
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
b814f0
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
b814f0
(cherry picked from commit d6e074d0d35221b0fac14c94fc79c98363f2f6c3)
b814f0
---
b814f0
 src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 3 +--
b814f0
 tests/auto/client/xdgshell/tst_xdgshell.cpp                 | 2 +-
b814f0
 2 files changed, 2 insertions(+), 3 deletions(-)
b814f0
b814f0
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
b814f0
index 3a1569f7..7d33dabd 100644
b814f0
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
b814f0
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
b814f0
@@ -105,8 +105,6 @@ void QWaylandXdgSurface::Toplevel::applyConfigure()
b814f0
         m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size);
b814f0
     }
b814f0
 
b814f0
-    m_xdgSurface->setSizeHints();
b814f0
-
b814f0
     m_applied = m_pending;
b814f0
     qCDebug(lcQpaWayland) << "Applied pending xdg_toplevel configure event:" << m_applied.size << m_applied.states;
b814f0
 }
b814f0
@@ -257,6 +255,7 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *s
b814f0
                 m_toplevel->set_parent(parentXdgSurface->m_toplevel->object());
b814f0
         }
b814f0
     }
b814f0
+    setSizeHints();
b814f0
 }
b814f0
 
b814f0
 QWaylandXdgSurface::~QWaylandXdgSurface()
b814f0
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp
b814f0
index 2277bbb8..2fdd0a7c 100644
b814f0
--- a/tests/auto/client/xdgshell/tst_xdgshell.cpp
b814f0
+++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp
b814f0
@@ -505,7 +505,7 @@ void tst_xdgshell::minMaxSize()
b814f0
     window.show();
b814f0
     QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
b814f0
 
b814f0
-    exec([=] { xdgToplevel()->sendCompleteConfigure(); });
b814f0
+    // we don't roundtrip with our configuration the initial commit should be correct
b814f0
 
b814f0
     QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(100, 100));
b814f0
     QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(1000, 1000));
b814f0
-- 
b814f0
2.35.1
b814f0