Set window dimensions properly when toggling full-screen

This commit is contained in:
Cameron Gutman
2018-07-20 16:01:22 -07:00
parent 48c2a8c5b0
commit e516861366
3 changed files with 97 additions and 50 deletions

View File

@@ -88,12 +88,7 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event)
else if (event->keysym.sym == SDLK_x) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Detected full-screen toggle combo");
if (SDL_GetWindowFlags(Session::s_ActiveSession->m_Window) & SDL_WINDOW_FULLSCREEN) {
SDL_SetWindowFullscreen(Session::s_ActiveSession->m_Window, 0);
}
else {
SDL_SetWindowFullscreen(Session::s_ActiveSession->m_Window, SDL_WINDOW_FULLSCREEN);
}
Session::s_ActiveSession->toggleFullscreen();
return;
}
}