From 24a18c2f34ca5f13705158826528340d21e55298 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 9 Nov 2018 11:20:19 +0100 Subject: [PATCH] Win32: fix window position saving use WM_WINDOWPOSCHANGED instead of WM_MOVE --- src/win32screen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/win32screen.c b/src/win32screen.c index 5c47a1b9..c5aeee1c 100644 --- a/src/win32screen.c +++ b/src/win32screen.c @@ -74,12 +74,24 @@ static LRESULT CALLBACK Win32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP switch(uMsg) { case WM_MOVE: + GFX2_Log(GFX2_DEBUG, "WM_MOVE : (%d,%d)\n", LOWORD(lParam), HIWORD(lParam)); if (!Win32_Is_Fullscreen) { Config.Window_pos_x = LOWORD(lParam); Config.Window_pos_y = HIWORD(lParam); } return 0; + case WM_WINDOWPOSCHANGED: + { + LPWINDOWPOS pos = (LPWINDOWPOS)lParam; + GFX2_Log(GFX2_DEBUG, "WM_WINDOWPOSCHANGED : (%d,%d) %dx%d\n", pos->x, pos->y, pos->cx, pos->cy); + if (!Win32_Is_Fullscreen) + { + Config.Window_pos_x = pos->x; + Config.Window_pos_y = pos->y; + } + } + return 0; case WM_NCHITTEST: // send to test in which part of the windows the coordinates are break;