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

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