Manage properly fullscreen in OutputGLWindow: it was possible to have the window without the fullscreen, which caused issues in some circumstances.

This commit is contained in:
Tats
2016-03-26 18:17:57 -04:00
parent 4c5e104b46
commit eca2e881d9
3 changed files with 15 additions and 20 deletions

View File

@@ -78,33 +78,25 @@ void OutputGLWindow::setFullScreen(bool fullscreen)
{
if (fullscreen)
{
// Check if user is on multiple screen
int screen = (QApplication::desktop()->screenCount() > 1 ? 1 : 0);
// Hide cursor
setCursorVisible(!fullscreen);
// Activate crosshair in fullscreen mode.
// should be only drawn if the controls should be shown
canvas->setDisplayCrosshair(fullscreen && canvas->getMainWindow()->displayControls());
// Check if user is on multiple screen (always pre
int screen = _getPreferredScreen();
//Move window to second screen before fullscreening it.
setGeometry(QApplication::desktop()->screenGeometry(screen));
//The problem related to the full screen on linux seems to be resolved
// with Qt 5.5 at least on Debian but define macro anyway
#ifdef Q_OS_LINUX
// The problem related to the full screen on linux seems to be resolved with Qt 5.5 on Debian.
// However this still seems to be needed on Ubuntu 15.10.
// Fix source:
// http://stackoverflow.com/questions/12645880/fullscreen-for-qdialog-from-within-mainwindow-only-working-sometimes
setWindowFlags(Qt::Window);
setVisible(true);
setWindowState( windowState() ^ Qt::WindowFullScreen );
show();
#else
showFullScreen();
#endif
showFullScreen();
}
else
{
#ifdef Q_OS_LINUX
setWindowFlags( windowFlags() & ~Qt::Window );
#else
showNormal();
#endif
hide();
}
}
void OutputGLWindow::setDisplayCrosshair(bool crosshair)
{