From 36aa243d10d62bb06542f43642ba74c83435c927 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sat, 8 Jul 2023 04:11:26 +0200 Subject: [PATCH] use SetWindowPos to fix mouse lock bug in HOMM4 --- src/dd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/dd.c b/src/dd.c index 975464c..db376a8 100644 --- a/src/dd.c +++ b/src/dd.c @@ -764,12 +764,15 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl LONG exstyle = real_GetWindowLongA(g_ddraw->hwnd, GWL_EXSTYLE); AdjustWindowRectEx(&dst, style, GetMenu(g_ddraw->hwnd) != NULL, exstyle); - - real_SetWindowPos( - g_ddraw->hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); - real_MoveWindow( - g_ddraw->hwnd, dst.left, dst.top, (dst.right - dst.left), (dst.bottom - dst.top), TRUE); + real_SetWindowPos( + g_ddraw->hwnd, + HWND_NOTOPMOST, + dst.left, + dst.top, + (dst.right - dst.left), + (dst.bottom - dst.top), + SWP_SHOWWINDOW | SWP_FRAMECHANGED); BOOL d3d9_active = FALSE;