From df30b47aa73d519444f8f17cbc3237dd9218db13 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 14 Sep 2021 22:20:20 +0200 Subject: [PATCH] And fixed the behavior of that. --- src/win/win.c | 3 +-- src/win/win_specify_dim.c | 4 ++-- src/win/win_ui.c | 13 +++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/win/win.c b/src/win/win.c index 5c50f975e..a72a40709 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -1094,8 +1094,7 @@ plat_setfullscreen(int on) else ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height); - if (window_remember) - SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); + SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); } /* Render window. */ diff --git a/src/win/win_specify_dim.c b/src/win/win_specify_dim.c index 0282f6061..d4727c68b 100644 --- a/src/win/win_specify_dim.c +++ b/src/win/win_specify_dim.c @@ -97,7 +97,7 @@ SpecifyDimensionsDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM if (lock) { vid_resize = 2; - window_remember = 1; + window_remember = 0; } else { vid_resize = 1; window_remember = 1; @@ -140,7 +140,7 @@ SpecifyDimensionsDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM if (mouse_capture) ClipCursor(&r); - if (window_remember) { + if (window_remember || (vid_resize & 2)) { window_x = r.left; window_y = r.top; if (!(vid_resize & 2)) { diff --git a/src/win/win_ui.c b/src/win/win_ui.c index f28021751..75b0aad92 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -697,7 +697,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) window_remember = !window_remember; CheckMenuItem(hmenu, IDM_VID_REMEMBER, window_remember ? MF_CHECKED : MF_UNCHECKED); GetWindowRect(hwnd, &rect); - if (window_remember) { + if (window_remember || (vid_resize & 2)) { window_x = rect.left; window_y = rect.top; if (!(vid_resize & 2)) { @@ -980,11 +980,13 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) video_force_resize_set(1); } - if (window_remember) { + if (window_remember || (vid_resize & 2)) { window_x = pos->x; window_y = pos->y; - window_w = pos->cx; - window_h = pos->cy; + if (!(vid_resize & 2)) { + window_w = pos->cx; + window_h = pos->cy; + } save_window_pos = 1; config_save(); } @@ -1385,8 +1387,7 @@ ui_init(int nCmdShow) else ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height); - if (window_remember) - SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); + SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); } /* Reset all menus to their defaults. */