mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Fix fullscreen focus behavior
This commit is contained in:
@@ -68,7 +68,7 @@ void KeyPoll::disabletextentry()
|
||||
SDL_StopTextInput();
|
||||
}
|
||||
|
||||
void KeyPoll::Poll()
|
||||
void KeyPoll::Poll(Screen *screen)
|
||||
{
|
||||
SDL_Event evt;
|
||||
while (SDL_PollEvent(&evt))
|
||||
@@ -246,9 +246,14 @@ void KeyPoll::Poll()
|
||||
isActive = true;
|
||||
if (!useFullscreenSpaces)
|
||||
{
|
||||
SDL_Window *window = SDL_GetWindowFromID(evt.window.windowID);
|
||||
wasFullscreen = SDL_GetWindowFlags(window);
|
||||
SDL_SetWindowFullscreen(window, 0);
|
||||
if (wasFullscreen)
|
||||
{
|
||||
screen->isWindowed = false;
|
||||
SDL_SetWindowFullscreen(
|
||||
SDL_GetWindowFromID(evt.window.windowID),
|
||||
SDL_WINDOW_FULLSCREEN_DESKTOP
|
||||
);
|
||||
}
|
||||
}
|
||||
SDL_DisableScreenSaver();
|
||||
}
|
||||
@@ -257,9 +262,11 @@ void KeyPoll::Poll()
|
||||
isActive = false;
|
||||
if (!useFullscreenSpaces)
|
||||
{
|
||||
wasFullscreen = !screen->isWindowed;
|
||||
screen->isWindowed = true;
|
||||
SDL_SetWindowFullscreen(
|
||||
SDL_GetWindowFromID(evt.window.windowID),
|
||||
wasFullscreen
|
||||
0
|
||||
);
|
||||
}
|
||||
SDL_EnableScreenSaver();
|
||||
|
||||
Reference in New Issue
Block a user