Commit 2c70ec41 authored by David Hurka's avatar David Hurka 🐬
Browse files

PresentationWidget: Fix screen switching at runtime

Screen switching from inside presentation mode currently does not work correctly.
The reason is that the widget geometry() shall be moved
*while* the widget is configured as fullscreen.
This patch temporarily disables fullscreen, so the screen can be switched.

You can check it with release 20.04:
Screen switching from within presentation mode will not work.
Set the widget to windowed (e. g. Alt+F3 or right-click in task manager),
screen switching will work now.

!233 shall port PresentationWidget to QScreen in release 20.12,
so this is just a compact workaround without much intelligence.
The drawback is that custom window rules might get confused when the
screen geometry changes for some reasons.
parent 72f5a2db
......@@ -1599,7 +1599,11 @@ void PresentationWidget::setScreen(int newScreen)
const QSize oldSize = size();
// qCDebug(OkularUiDebug) << newScreen << "=>" << screenGeom;
m_screen = newScreen;
// Workaround until !233: Disable fullscreen mode for moving the geometry() to another screen.
setWindowState(windowState() & ~Qt::WindowFullScreen);
setWindowState(windowState() | Qt::WindowFullScreen);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment