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

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