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.

Pick-to: 6.1 6.0 5.15
Change-Id: I757854c3698639472f3a25ef298ddcca031e1ed5
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Aleix Pol 2020-11-23 20:07:02 +01:00 committed by Liang Qi
parent 597278685a
commit 8e16ebe3fb

View File

@ -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();
}