From 8f12004d67325db6ce636d34c40cd0c65225036e Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Wed, 29 May 2024 05:10:25 +0200 Subject: [PATCH] tweak aero snap hack --- inc/wndproc.h | 1 + src/wndproc.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/wndproc.h b/inc/wndproc.h index 3cb6a97..43a1e8e 100644 --- a/inc/wndproc.h +++ b/inc/wndproc.h @@ -9,6 +9,7 @@ #define WM_DISPLAYCHANGE_DDRAW WM_APP+116 #define WM_TOGGLE_FULLSCREEN WM_APP+117 #define WM_TOGGLE_MAXIMIZE WM_APP+118 +#define WM_RESTORE_STYLE WM_APP+119 #define IDT_TIMER_LEAVE_BNET 541287654 diff --git a/src/wndproc.c b/src/wndproc.c index 365c683..812f96f 100644 --- a/src/wndproc.c +++ b/src/wndproc.c @@ -477,7 +477,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */ } - case WM_NCMOUSELEAVE: + case WM_RESTORE_STYLE: { if (!IsWine()) /* hack: disable aero snap */ { @@ -488,7 +488,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam real_SetWindowLongA(g_ddraw.hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX); } } - break; + return 0; } case WM_SYSCOMMAND: { @@ -499,6 +499,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam if ((style & WS_MAXIMIZEBOX)) { real_SetWindowLongA(g_ddraw.hwnd, GWL_STYLE, style & ~WS_MAXIMIZEBOX); + PostMessageA(g_ddraw.hwnd, WM_RESTORE_STYLE, 0, 0); } }