From b9e714dd1d5e0824c526d2495262c0b259e0c35d Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Wed, 11 Feb 2026 23:39:09 +0100 Subject: [PATCH] touch: always show cursor if enabled --- common/hooklib/touch.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/common/hooklib/touch.c b/common/hooklib/touch.c index a76692a..c5564df 100644 --- a/common/hooklib/touch.c +++ b/common/hooklib/touch.c @@ -43,6 +43,8 @@ static BOOL WINAPI hook_GetTouchInputInfo( static HCURSOR WINAPI hook_SetCursor(HCURSOR cursor); +static int WINAPI hook_ShowCursor(BOOL bShow); + /* Link pointers */ static ATOM (WINAPI *next_RegisterClassExA)( @@ -67,6 +69,9 @@ static BOOL (WINAPI *next_GetTouchInputInfo)( static HCURSOR(WINAPI *next_SetCursor)(HCURSOR cursor); +static int (WINAPI *next_ShowCursor)(BOOL bShow); + + static bool touch_hook_initted; static bool touch_held; static HWND registered_hWnd; @@ -100,6 +105,11 @@ static const struct hook_symbol touch_hooks[] = { .patch = hook_SetCursor, .link = (void **) &next_SetCursor }, + { + .name = "ShowCursor", + .patch = hook_ShowCursor, + .link = (void **) &next_ShowCursor + }, }; void touch_screen_hook_init(const struct touch_screen_config *cfg, HINSTANCE self) @@ -132,8 +142,15 @@ void touch_hook_insert_hooks(HMODULE target) _countof(touch_hooks)); } +static int WINAPI hook_ShowCursor(BOOL bShow) { + if (touch_config.cursor) + return next_ShowCursor(1); + + return next_ShowCursor(bShow); +} + static HCURSOR WINAPI hook_SetCursor(HCURSOR cursor) { - if (cursor == 0 && touch_config.cursor) + if (touch_config.cursor) return next_SetCursor(defaultCursor); return next_SetCursor(cursor);