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

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