Blame SOURCES/qtwayland-tell-compositor-screen-we-are-expecting-to-fill.patch

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