From b1c74f1628e6e7b7b7405ed653552342ae2b1f87 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sat, 10 Aug 2024 03:28:12 +0200 Subject: [PATCH] remove allow_wmactivate setting --- inc/config.h | 1 - src/config.c | 8 -------- src/wndproc.c | 19 +++++++++++++++---- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/inc/config.h b/inc/config.h index 3a33eaf..c111c6b 100644 --- a/inc/config.h +++ b/inc/config.h @@ -65,7 +65,6 @@ typedef struct CNCDDRAWCONFIG int guard_lines; int max_resolutions; BOOL lock_surfaces; - BOOL allow_wmactivate; BOOL flipclear; BOOL fixmousehook; BOOL rgb555; diff --git a/src/config.c b/src/config.c index b183d56..6223d28 100644 --- a/src/config.c +++ b/src/config.c @@ -78,7 +78,6 @@ void cfg_load() GET_INT(g_config.guard_lines, "guard_lines", 200); GET_INT(g_config.max_resolutions, "max_resolutions", 0); GET_BOOL(g_config.lock_surfaces, "lock_surfaces", FALSE); - GET_BOOL(g_config.allow_wmactivate, "allow_wmactivate", FALSE); GET_BOOL(g_config.flipclear, "flipclear", FALSE); GET_BOOL(g_config.fixmousehook, "fixmousehook", FALSE); GET_BOOL(g_config.rgb555, "rgb555", FALSE); @@ -302,7 +301,6 @@ static void cfg_create_ini() "guard_lines=200\n" "max_resolutions=0\n" "lock_surfaces=false\n" - "allow_wmactivate=false\n" "flipclear=false\n" "fixmousehook=false\n" "rgb555=false\n" @@ -368,7 +366,6 @@ static void cfg_create_ini() "; Atrox\n" "[Atrox]\n" "nonexclusive=true\n" - "allow_wmactivate=true\n" "\n" "; Atomic Bomberman\n" "[BM]\n" @@ -473,10 +470,6 @@ static void cfg_create_ini() "[Arthur]\n" "renderer=gdi\n" "\n" - "; Barbie(R) Photo Designer\n" - "[pdcam]\n" - "allow_wmactivate=true\n" - "\n" "; Baldur's Gate II\n" "; Note: 'Use 3D Acceleration' must be disabled and 'Full Screen' must be enabled in BGConfig.exe\n" "[BGMain]\n" @@ -535,7 +528,6 @@ static void cfg_create_ini() "\n" "; Carmen Sandiego's Great Chase - NOT WORKING YET\n" "[TIME32]\n" - "allow_wmactivate=true\n" "renderer=gdi\n" "adjmouse=false\n" "width=0\n" diff --git a/src/wndproc.c b/src/wndproc.c index ebde744..d0e32ee 100644 --- a/src/wndproc.c +++ b/src/wndproc.c @@ -557,13 +557,13 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam } case WM_ACTIVATE: { - if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE) + if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE) { if (g_ddraw.got_child_windows) RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); } - if (wParam == WA_INACTIVE) + if (LOWORD(wParam) == WA_INACTIVE) { if (g_config.windowed && !g_config.fullscreen && lParam && GetParent((HWND)lParam) == hWnd) { @@ -600,10 +600,21 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam } } - //if (g_ddraw.windowed || g_ddraw.noactivateapp) + if (g_config.windowed || g_config.noactivateapp) + { + /* let it pass through once (Atrox) */ + static BOOL one_time; + + if (!one_time) + { + one_time = TRUE; + + if (LOWORD(wParam)) + break; + } - if (!g_config.allow_wmactivate) return 0; + } break; }