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

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