]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Use SetWindowPos only if RP mode is not active.
authorToni Wilen <twilen@winuae.net>
Sat, 17 Jan 2026 10:58:27 +0000 (12:58 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 17 Jan 2026 10:58:27 +0000 (12:58 +0200)
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gfx.cpp

index b6be0363b0f06939bede10f03518398eb0156b9e..cfd0afa0c9229ee140203edba3869c922806230f 100644 (file)
@@ -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;
index 55346b4413892006f9682d0fd11f8a128dd88e94..789088e4c89cafbbbb1982c061805dc68cd22f4a 100644 (file)
@@ -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);
index 4da9cb219ad01048ab5fcc3bf8953aebfa55bb63..cc082a6059eb19782e3a1a4cdd18df6997a80163 100644 (file)
@@ -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;