mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed F4 (fullscreen hotkey) not actually changing window mode
This commit is contained in:
parent
7a6540ec2f
commit
949c0cff70
@ -164,6 +164,7 @@ void InputHandler::preprocessEvent(const SDL_Event & ev)
|
||||
{
|
||||
if(ev.key.keysym.sym == SDLK_F4 && (ev.key.keysym.mod & KMOD_ALT))
|
||||
{
|
||||
// FIXME: dead code? Looks like intercepted by OS/SDL and delivered as SDL_Quit instead?
|
||||
boost::mutex::scoped_lock interfaceLock(GH.interfaceMutex);
|
||||
handleQuit(true);
|
||||
return;
|
||||
@ -175,16 +176,6 @@ void InputHandler::preprocessEvent(const SDL_Event & ev)
|
||||
handleQuit(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if(ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_F4)
|
||||
{
|
||||
boost::mutex::scoped_lock interfaceLock(GH.interfaceMutex);
|
||||
Settings full = settings.write["video"]["fullscreen"];
|
||||
full->Bool() = !full->Bool();
|
||||
|
||||
GH.onScreenResize(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(ev.type == SDL_USEREVENT)
|
||||
{
|
||||
|
@ -78,6 +78,13 @@ void InputSourceKeyboard::handleEventKeyDown(const SDL_KeyboardEvent & key)
|
||||
if (vstd::contains(shortcutsVector, EShortcut::MAIN_MENU_LOBBY))
|
||||
CSH->getGlobalLobby().activateInterface();
|
||||
|
||||
if (vstd::contains(shortcutsVector, EShortcut::GLOBAL_FULLSCREEN))
|
||||
{
|
||||
Settings full = settings.write["video"]["fullscreen"];
|
||||
full->Bool() = !full->Bool();
|
||||
GH.onScreenResize(true);
|
||||
}
|
||||
|
||||
if (vstd::contains(shortcutsVector, EShortcut::SPECTATE_TRACK_HERO))
|
||||
{
|
||||
Settings s = settings.write["session"];
|
||||
|
Loading…
Reference in New Issue
Block a user