Fix #7480 where we would lose the keyboard after activating fullscreen with the mouse

This commit is contained in:
Henrik Rydgard 2015-02-15 23:07:24 +01:00
parent 83f81eaaf1
commit 66e9877561
3 changed files with 11 additions and 5 deletions

View File

@ -86,6 +86,9 @@ namespace WindowsRawInput {
info.cbSize = sizeof(info);
if (GetMenuBarInfo(MainWindow::GetHWND(), OBJID_MENU, 0, &info) != 0) {
menuActive = info.fBarFocused != FALSE;
} else {
// In fullscreen mode, we remove the menu
menuActive = false;
}
return menuActive;
}

View File

@ -311,7 +311,7 @@ namespace MainWindow
}
}
void ToggleFullscreen(HWND hWnd, bool goingFullscreen = false) {
void ToggleFullscreen(HWND hWnd, bool goingFullscreen) {
// Make sure no rendering is happening during the switch.
Core_NotifyWindowHidden(true);
g_inModeSwitch = true; // Make sure WM_SIZE doesn't call Core_NotifyWindowHidden(false)...
@ -372,6 +372,7 @@ namespace MainWindow
g_inModeSwitch = false;
Core_NotifyWindowHidden(false);
WindowsRawInput::NotifyMenu();
}
RECT DetermineWindowRectangle() {
@ -1530,10 +1531,7 @@ namespace MainWindow
break;
case ID_OPTIONS_FULLSCREEN:
g_Config.bFullScreen = !g_Config.bFullScreen;
ToggleFullscreen(hwndMain, g_Config.bFullScreen);
PostMessage(hWnd, WM_USER_TOGGLE_FULLSCREEN, 0, 0);
break;
case ID_OPTIONS_VERTEXCACHE:
@ -1620,6 +1618,10 @@ namespace MainWindow
}
break;
case WM_USER_TOGGLE_FULLSCREEN:
ToggleFullscreen(hwndMain, !g_Config.bFullScreen);
break;
case WM_INPUT:
return WindowsRawInput::Process(hWnd, wParam, lParam);

View File

@ -13,6 +13,7 @@ namespace MainWindow
WM_USER_UPDATE_SCREEN = WM_USER + 102,
WM_USER_WINDOW_TITLE_CHANGED = WM_USER + 103,
WM_USER_BROWSE_BOOT_DONE = WM_USER + 104,
WM_USER_TOGGLE_FULLSCREEN = WM_USER + 105,
};
enum {