summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2020-11-23 20:07:02 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-26 02:16:09 +0000
commitb3995c860510ee3892c154e2886d300898c17b5e (patch)
tree74a7febf9738893c286e90944ad4d0f465fd6c59
parentc6880513f315e00bbd7cfabbc4c3260f46c5da78 (diff)
downloadqtwayland-b3995c860510ee3892c154e2886d300898c17b5e.tar.gz
xdgshell: Tell the compositor the screen we're expecting to fill
The xdgshell protocol allows us to tell the output to fill. This makes it possible to use fullscreen confidently on systems with multiple screens knowing that our windows won't be overlapping one another by calling setScreen accordingly before QWindow::showFullScreen. Change-Id: I757854c3698639472f3a25ef298ddcca031e1ed5 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit f915e53eaa596654ee1b9726a4767a1cba11336f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
index ae2d46dd..365a6c4e 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
@@ -178,9 +178,12 @@ void QWaylandXdgSurface::Toplevel::requestWindowStates(Qt::WindowStates states)
}
if (changedStates & Qt::WindowFullScreen) {
- if (states & Qt::WindowFullScreen)
- set_fullscreen(nullptr);
- else
+ if (states & Qt::WindowFullScreen) {
+ auto screen = m_xdgSurface->window()->waylandScreen();
+ if (screen) {
+ set_fullscreen(screen->output());
+ }
+ } else
unset_fullscreen();
}