diff --git a/src/utils/misc.py b/src/utils/misc.py index 28c7d3f..5cf894f 100644 --- a/src/utils/misc.py +++ b/src/utils/misc.py @@ -184,7 +184,11 @@ def move_d2r_window(client_x, client_y, client_width=None, client_height=None): outer_y = client_y - (client_top - wr_top) outer_w = (client_width if client_width else (c_right - c_left)) + border_w outer_h = (client_height if client_height else (c_bottom - c_top)) + border_h - SetWindowPos(hwnd, HWND_TOPMOST, outer_x, outer_y, outer_w, outer_h, SWP_SHOWWINDOW) + try: + SetWindowPos(hwnd, HWND_TOPMOST, outer_x, outer_y, outer_w, outer_h, SWP_SHOWWINDOW) + except pywintypes.error: + Logger.debug("SetWindowPos denied in move_d2r_window (D2R elevated) — skipping") + return False Logger.debug( f"Moved D2R client area to ({client_x}, {client_y}) " f"with size {client_width or c_right - c_left}x{client_height or c_bottom - c_top}"