Win32: Fix a minor fullscreen bug.

If the window is maximized before going fullscreen, the taskbar appears on top, which is not desirable.
Also, apply the maximized state properly again after exiting, if the user had the window maximized.
This commit is contained in:
The Dax 2014-07-29 18:18:57 -04:00
parent 682e1c1f74
commit 8c27b5f456

View File

@ -135,6 +135,7 @@ namespace MainWindow
static W32Util::AsyncBrowseDialog *browseDialog;
static bool browsePauseAfter;
static bool g_inModeSwitch; // when true, don't react to WM_SIZE
static int g_WindowState;
#define MAX_LOADSTRING 100
const TCHAR *szTitle = TEXT("PPSSPP");
@ -328,6 +329,11 @@ namespace MainWindow
// Put back the menu bar.
::SetMenu(hWnd, menu);
} else {
// If the window was maximized before going fullscreen, make sure to restore first
// in order not to have the taskbar show up on top of PPSSPP.
if (g_WindowState == SIZE_MAXIMIZED) {
ShowWindow(hwndMain, SW_RESTORE);
}
// Remember the normal window rectangle.
::GetWindowRect(hWnd, &g_normalRC);
@ -345,7 +351,12 @@ namespace MainWindow
::SetMenu(hWnd, goingFullscreen ? NULL : menu);
// Resize to the appropriate view.
ShowWindow(hwndMain, goingFullscreen ? SW_MAXIMIZE : SW_RESTORE);
// If we're returning to window mode, re-apply the appropriate size setting.
if (goingFullscreen) {
ShowWindow(hwndMain, SW_MAXIMIZE);
} else {
ShowWindow(hwndMain, g_WindowState == SIZE_MAXIMIZED ? SW_MAXIMIZE : SW_RESTORE);
}
g_Config.bFullScreen = goingFullscreen;
CorrectCursor();
@ -1098,6 +1109,7 @@ namespace MainWindow
}
SavePosition();
ResizeDisplay();
g_WindowState = wParam;
break;
case SIZE_MINIMIZED:
Core_NotifyWindowHidden(true);