Bug #99 fix and improvements

This commit is contained in:
baydam
2015-04-02 17:11:58 +00:00
parent a39fa73118
commit 36b89fa60a
2 changed files with 12 additions and 9 deletions
+12 -8
View File
@@ -85,6 +85,7 @@ void OutputGLWindow::setFullScreen(bool fullscreen)
{
// Save window geometry.
_geometry = saveGeometry();
//qDebug() << "Saving Geometry " << _geometry.toHex() << endl;
// Move window to second screen before fullscreening it.
if (QApplication::desktop()->screenCount() > 1)
@@ -92,10 +93,10 @@ void OutputGLWindow::setFullScreen(bool fullscreen)
#ifdef Q_OS_UNIX
// Special case for Unity.
if (session == "ubuntu" || session == "gnome") {
setWindowFlags(Qt::Window | Qt::WindowStaysOnTopHint);
setWindowState( windowState() | Qt::WindowFullScreen );
if (session == "ubuntu" || session == "gnome" || session == "default") {
setWindowFlags(Qt::Window);
setVisible(true);
setWindowState( windowState() ^ Qt::WindowFullScreen );
show();
} else {
showFullScreen();
@@ -107,16 +108,19 @@ void OutputGLWindow::setFullScreen(bool fullscreen)
else
{
// Restore geometry of window to what it was before full screen call.
restoreGeometry(_geometry);
//restoreGeometry(_geometry);
#ifdef Q_OS_UNIX
// Special case for Unity.
if (session == "ubuntu" || session == "gnome") {
setWindowState( windowState() & ~Qt::WindowFullScreen );
} else {
if (session == "ubuntu") {
showNormal();
} else {
restoreGeometry(_geometry);
showNormal();
setWindowFlags( windowFlags() & ~Qt::Window );
}
#else
restoreGeometry(_geometry);
showNormal();
#endif
}