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

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