From a80584664c1ebc9136ba1647d58f30994fa6ed67 Mon Sep 17 00:00:00 2001 From: jpcerrone Date: Mon, 12 Jun 2023 15:22:45 -0300 Subject: [PATCH] Fix window resizing problems on Windows Fixes godotengine#76847, Fixes godotengine#74286 Reorders problematic steps from the DisplayServerWindows::window_set_mode function. These were causing a resize with the dimensions of the previously used mode instead of the current one. --- platform/windows/display_server_windows.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index b1a265068a1..fc208eb4bb0 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -1384,6 +1384,8 @@ void DisplayServerWindows::window_set_mode(WindowMode p_mode, WindowID p_window) wd.multiwindow_fs = false; wd.maximized = wd.was_maximized; + _update_window_style(p_window, false); + if (wd.pre_fs_valid) { rect = wd.pre_fs_rect; } else { @@ -1394,8 +1396,6 @@ void DisplayServerWindows::window_set_mode(WindowMode p_mode, WindowID p_window) wd.pre_fs_valid = true; } - _update_window_style(p_window, false); - MoveWindow(wd.hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); if (restore_mouse_trails > 1) {