From: Toni Wilen Date: Sat, 17 Jan 2026 10:58:27 +0000 (+0200) Subject: Use SetWindowPos only if RP mode is not active. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=2f6eefebbda8b9d5a789dbb7f5189530e6907ccc;p=francis%2Fwinuae.git Use SetWindowPos only if RP mode is not active. --- diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index b6be0363..cfd0afa0 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -236,6 +236,13 @@ static GETDPIFORMONITOR pGetDpiForMonitor; typedef UINT(CALLBACK* GETDPIFORWINDOW)(HWND); static GETDPIFORWINDOW pGetDpiForWindow; +BOOL xSetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags) +{ + if (!rp_isactive()) { + return SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags); + } +} + int getdpiformonitor(HMONITOR mon) { if (mon) { @@ -2070,7 +2077,7 @@ static void CustomResizeMouseMove(AmigaMonitor *mon, HWND hWindow) r2.right = x + w; r2.bottom = y + h; doresizing(mon, nSizingEdge, &r2); - SetWindowPos(hWindow, NULL, r2.left, r2.top, r2.right - r2.left, r2.bottom - r2.top, 0); + xSetWindowPos(hWindow, NULL, r2.left, r2.top, r2.right - r2.left, r2.bottom - r2.top, 0); } ptResizePos.x = pt.x; ptResizePos.y = pt.y; @@ -2082,7 +2089,7 @@ static void EndCustomResize(HWND hWindow, BOOL bCanceled) inresizing = false; ReleaseCapture(); if (bCanceled) { - SetWindowPos(hWindow, NULL, rcResizeStartWindowRect.left, rcResizeStartWindowRect.top, + xSetWindowPos(hWindow, NULL, rcResizeStartWindowRect.left, rcResizeStartWindowRect.top, rcResizeStartWindowRect.right - rcResizeStartWindowRect.left, rcResizeStartWindowRect.bottom - rcResizeStartWindowRect.top, SWP_NOZORDER | SWP_NOACTIVATE); } @@ -3005,7 +3012,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, { if (isfullscreen() == 0) { RECT* const r = (RECT*)lParam; - SetWindowPos(hWnd, NULL, r->left, r->top, r->right - r->left, r->bottom - r->top, SWP_NOZORDER | SWP_NOACTIVATE); + xSetWindowPos(hWnd, NULL, r->left, r->top, r->right - r->left, r->bottom - r->top, SWP_NOZORDER | SWP_NOACTIVATE); return 0; } break; diff --git a/od-win32/win32.h b/od-win32/win32.h index 55346b44..789088e4 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -81,6 +81,7 @@ extern bool setpaused (int priority); extern void unsetminimized (int monid); extern void setminimized(int monid); extern int getfocusedmonitor(void); +BOOL xSetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags); void finishjob(void); void init_colors(int monid); diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 4da9cb21..cc082a60 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -3458,12 +3458,12 @@ static int create_windows(struct AmigaMonitor *mon) #endif x = r.left; y = r.top; - SetWindowPos(mon->hMainWnd, HWND_TOP, x, y, w + mon->window_extra_width, h + mon->window_extra_height, + xSetWindowPos(mon->hMainWnd, HWND_TOP, x, y, w + mon->window_extra_width, h + mon->window_extra_height, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSENDCHANGING | SWP_NOZORDER); x = gap; y = gap; } - SetWindowPos(mon->hAmigaWnd, HWND_TOP, x, y, w, h, + xSetWindowPos(mon->hAmigaWnd, HWND_TOP, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSENDCHANGING | SWP_NOZORDER); mon->in_sizemove--; mon->dpi = dpi;