Fix window not resetting properly when toggling out of fullscreen, formatting

This commit is contained in:
XenoMustache 2025-12-02 12:28:14 -08:00
parent 2b1d88cb98
commit 2380772eeb

View File

@ -275,9 +275,6 @@ void ToggleBorderlessWindowed(void)
mode->refreshRate mode->refreshRate
); );
// glfwSetWindowPos(platform.handle, monitorPosX, monitorPosY);
// glfwSetWindowSize(platform.handle, monitorWidth, monitorHeight);
// Refocus window // Refocus window
glfwFocusWindow(platform.handle); glfwFocusWindow(platform.handle);
@ -291,8 +288,15 @@ void ToggleBorderlessWindowed(void)
// Return previous screen size and position // Return previous screen size and position
// NOTE: The order matters here, it must set size first, then set position, otherwise the screen will be positioned incorrectly // NOTE: The order matters here, it must set size first, then set position, otherwise the screen will be positioned incorrectly
glfwSetWindowSize(platform.handle, CORE.Window.previousScreen.width, CORE.Window.previousScreen.height); glfwSetWindowMonitor(
glfwSetWindowPos(platform.handle, CORE.Window.previousPosition.x, CORE.Window.previousPosition.y); platform.handle,
NULL,
CORE.Window.previousPosition.x,
CORE.Window.previousPosition.y,
CORE.Window.previousScreen.width,
CORE.Window.previousScreen.height,
mode->refreshRate
);
// Refocus window // Refocus window
glfwFocusWindow(platform.handle); glfwFocusWindow(platform.handle);