From 133950f12d2f4433ef48db8f1629c84e32faf82e Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Mon, 10 Dec 2018 03:36:51 +0100 Subject: [PATCH] improve ClientToScreen and ScreenToClient hooks - fixes tiberian sun save game confirmation dialog --- ddraw.rc | 2 +- src/mouse.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ddraw.rc b/ddraw.rc index a0bd635..b8e5462 100644 --- a/ddraw.rc +++ b/ddraw.rc @@ -4,7 +4,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_BUILD 3 -#define VERSION_REVISION 0 +#define VERSION_REVISION 2 #define VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION #define VERSION_STRING ver_str(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION) diff --git a/src/mouse.c b/src/mouse.c index 93d75c2..01be2b8 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -362,11 +362,17 @@ BOOL WINAPI fake_GetClientRect(HWND hWnd, LPRECT lpRect) BOOL WINAPI fake_ClientToScreen(HWND hWnd, LPPOINT lpPoint) { + if (ddraw && ddraw->hWnd != hWnd) + return ClientToScreen(hWnd, lpPoint) && ScreenToClient(ddraw->hWnd, lpPoint); + return TRUE; } BOOL WINAPI fake_ScreenToClient(HWND hWnd, LPPOINT lpPoint) { + if (ddraw && ddraw->hWnd != hWnd) + return ClientToScreen(ddraw->hWnd, lpPoint) && ScreenToClient(hWnd, lpPoint); + return TRUE; }