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

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