explicit focus request in ToggleFullscreen()

fix issue mentioned by @paulmelis ?
This commit is contained in:
SuperUserNameMan 2024-07-12 13:09:38 +02:00 committed by GitHub
parent b004531efb
commit 1b800a14eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,7 +172,7 @@ void ToggleFullscreen(void)
if (monitor == NULL) if (monitor == NULL)
{ {
TRACELOG(LOG_WARNING, "GLFW: Failed to get monitor"); TRACELOG(LOG_WARNING, "GLFW: ToggleFullscreen() failed to get monitor");
CORE.Window.fullscreen = false; CORE.Window.fullscreen = false;
CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE; CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE;
@ -214,6 +214,9 @@ void ToggleFullscreen(void)
WindowSizeCallback(platform.handle, CORE.Window.previousScreen.width, CORE.Window.previousScreen.height); WindowSizeCallback(platform.handle, CORE.Window.previousScreen.width, CORE.Window.previousScreen.height);
} }
// Refocus window
glfwFocusWindow(platform.handle);
// Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS)
// NOTE: V-Sync can be enabled by graphic driver configuration // NOTE: V-Sync can be enabled by graphic driver configuration
if (CORE.Window.flags & FLAG_VSYNC_HINT) glfwSwapInterval(1); if (CORE.Window.flags & FLAG_VSYNC_HINT) glfwSwapInterval(1);