]> Shamusworld >> Repos - virtualjaguar/commitdiff
Fix for fullscreen bug in upgrade to Qt 5.
authorShamus Hammons <jlhamm@acm.org>
Sat, 15 Nov 2014 18:28:45 +0000 (12:28 -0600)
committerShamus Hammons <jlhamm@acm.org>
Sat, 15 Nov 2014 18:28:45 +0000 (12:28 -0600)
src/gui/app.cpp
src/gui/mainwin.cpp
src/gui/profile.cpp
src/gui/profile.h
virtualjaguar.pro

index e0b942be432bcf05c4120d7a2e7cb4f7c915f5b4..9414dd4c6674ded2126adbacff1df1ef948e966c 100644 (file)
@@ -7,7 +7,7 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  -----------------------------------------------------------
 // JLH  12/23/2009  Created this file
 // JLH  01/21/2011  Added SDL initialization
 // JLH  06/26/2011  Added fix to keep SDL from hijacking main() on win32
index 29363055dd2c86d34fbea135bb0d1e6df37ab648..f2c45ab00ebe8b22ffcc13920e5a77e50200e8fa 100644 (file)
@@ -1016,11 +1016,9 @@ void MainWin::SetFullScreen(bool state/*= true*/)
                if (debugbar)
                        debugbar->hide();
 
-               showFullScreen();
                // This is needed because the fullscreen may happen on a different
                // screen than screen 0:
                int screenNum = QApplication::desktop()->screenNumber(videoWidget);
-//             QRect r = QApplication::desktop()->availableGeometry(screenNum);
                QRect r = QApplication::desktop()->screenGeometry(screenNum);
                double targetWidth = (double)VIRTUAL_SCREEN_WIDTH,
                        targetHeight = (double)(vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL);
@@ -1036,6 +1034,11 @@ void MainWin::SetFullScreen(bool state/*= true*/)
        }
        else
        {
+               // Seems Qt is fussy about this: showNormal() has to go first, or it
+               // will keep the window stuck in a psuedo-fullscreen mode with no way
+               // to get out of it (except closing the app).
+               showNormal();
+
                // Reset the video widget to windowed mode
                videoWidget->offset = 0;
                videoWidget->fullscreen = false;
@@ -1046,7 +1049,6 @@ void MainWin::SetFullScreen(bool state/*= true*/)
                if (debugbar)
                        debugbar->show();
 
-               showNormal();
                ResizeMainWindow();
                move(mainWinPosition);
        }
@@ -1112,14 +1114,7 @@ void MainWin::ResizeMainWindow(void)
                }
        }
 
-       show();
-
-       for(int i=0; i<2; i++)
-       {
-               resize(0, 0);
-               usleep(2000);
-               QApplication::processEvents();
-       }
+       adjustSize();
 }
 
 
index 484d4b4f8e79f01d07b837d5661c432cd0d2b99e..a1bb92692534076041bb3b4794582f168b1e7ebf 100644 (file)
@@ -30,6 +30,7 @@
 //
 
 #include "profile.h"
+#include <QtWidgets>
 #include "gamepad.h"
 #include "log.h"
 #include "settings.h"
index 6c5a96fa2394912ba83f0d853d2d56b657397097..211a8a52857398a3bb6a7bcf7b87322366c24b73 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __PROFILE_H__
 #define __PROFILE_H__
 
-#include <QtWidgets>
 #include <stdint.h>
 
 class QComboBox;
index 6976d85afc8a9ad672e2ecb7e4e678f5b8f79b8a..9c3706fef89270b38b2e62c1bf16b69181506e10 100644 (file)
@@ -18,8 +18,7 @@ CONFIG    += qt warn_on release
 # debug
 RESOURCES += src/gui/virtualjaguar.qrc
 LIBS      += -Lobj -Lsrc/m68000/obj -ljaguarcore -lz -lm68k
-QT        += opengl
-QT += widgets
+QT        += opengl widgets
 
 # We stuff all the intermediate crap into obj/ so it won't confuse us mere
 # mortals ;-)