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

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