From c54477b7e68b7c9c5065b6ce7f290c7998a407ab Mon Sep 17 00:00:00 2001 From: Alvin Wong Date: Sat, 29 Jun 2024 18:24:45 +0800 Subject: [PATCH] Windows: Restore to windowed mode using SW_NORMAL If window was maximized before minimizing, restoring the window afterwards using SW_RESTORE seems to cause the window to forget its original size and position before being maximized, causing the window to fill the screen instead. --- platform/windows/display_server_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 838beddac28..6a52823e3e9 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2008,7 +2008,7 @@ void DisplayServerWindows::window_set_mode(WindowMode p_mode, WindowID p_window) } if (p_mode == WINDOW_MODE_WINDOWED) { - ShowWindow(wd.hWnd, SW_RESTORE); + ShowWindow(wd.hWnd, SW_NORMAL); wd.maximized = false; wd.minimized = false; }