From 065b8cc0c371135ae795e1db7c29d2919d16491b Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 18 Sep 2021 00:01:39 +0200 Subject: [PATCH] Using MoveWindow instead of SetWindowPos to move the window now, which actually works. --- src/win/win.c | 5 +++-- src/win/win_ui.c | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/win/win.c b/src/win/win.c index a72a40709..f3f96cb2e 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -1089,12 +1089,13 @@ plat_setfullscreen(int on) } /* Main Window. */ + if (vid_resize >= 2) + MoveWindow(hwndMain, window_x, window_y, window_w, window_h, TRUE); + if (hide_status_bar) ResizeWindowByClientArea(hwndMain, temp_x, temp_y); else ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height); - - SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); } /* Render window. */ diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 75b0aad92..79cc3a121 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -980,7 +980,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) video_force_resize_set(1); } - if (window_remember || (vid_resize & 2)) { + if (!(pos->flags & SWP_NOSIZE) && (window_remember || (vid_resize & 2))) { window_x = pos->x; window_y = pos->y; if (!(vid_resize & 2)) { @@ -1379,6 +1379,7 @@ ui_init(int nCmdShow) MoveWindow(hwnd, window_x, window_y, window_w, window_h, TRUE); else { if (vid_resize >= 2) { + MoveWindow(hwnd, window_x, window_y, window_w, window_h, TRUE); scrnsz_x = fixed_size_x; scrnsz_y = fixed_size_y; } @@ -1386,8 +1387,6 @@ ui_init(int nCmdShow) ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y); else ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height); - - SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); } /* Reset all menus to their defaults. */