X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=f2c45ab00ebe8b22ffcc13920e5a77e50200e8fa;hb=c76bbd5328bac525dddb05242fa1f32ebbf202cc;hp=29363055dd2c86d34fbea135bb0d1e6df37ab648;hpb=ddac3e0e78a5c4b0236bdeaff18cf9a3ac4ba4f7;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 2936305..f2c45ab 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -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(); }