Blame SOURCES/0005-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch

f38a11
From f408482e4364293e5ab9889854a759796436971d Mon Sep 17 00:00:00 2001
b814f0
From: Aleix Pol <aleixpol@kde.org>
b814f0
Date: Mon, 23 Nov 2020 20:07:02 +0100
f38a11
Subject: [PATCH 05/40] xdgshell: Tell the compositor the screen we're
b814f0
 expecting to fill
b814f0
b814f0
The xdgshell protocol allows us to tell the output to fill. This makes
b814f0
it possible to use fullscreen confidently on systems with multiple
b814f0
screens knowing that our windows won't be overlapping one another by
b814f0
calling setScreen accordingly before QWindow::showFullScreen.
b814f0
b814f0
Pick-to: 6.1 6.0 5.15
b814f0
Change-Id: I757854c3698639472f3a25ef298ddcca031e1ed5
b814f0
Reviewed-by: David Edmundson <davidedmundson@kde.org>
b814f0
---
b814f0
 .../shellintegration/xdg-shell/qwaylandxdgshell.cpp      | 9 ++++++---
b814f0
 1 file changed, 6 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 1c762944..3a1569f7 100644
b814f0
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
b814f0
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
b814f0
@@ -178,9 +178,12 @@ void QWaylandXdgSurface::Toplevel::requestWindowStates(Qt::WindowStates states)
b814f0
     }
b814f0
 
b814f0
     if (changedStates & Qt::WindowFullScreen) {
b814f0
-        if (states & Qt::WindowFullScreen)
b814f0
-            set_fullscreen(nullptr);
b814f0
-        else
b814f0
+        if (states & Qt::WindowFullScreen) {
b814f0
+            auto screen = m_xdgSurface->window()->waylandScreen();
b814f0
+            if (screen) {
b814f0
+                set_fullscreen(screen->output());
b814f0
+            }
b814f0
+        } else
b814f0
             unset_fullscreen();
b814f0
     }
b814f0
 
b814f0
-- 
b814f0
2.35.1
b814f0