Module: wine Branch: master Commit: 3cca65e3283d12d5b61b2ac9b314c36c30a3fa1d URL: https://gitlab.winehq.org/wine/wine/-/commit/3cca65e3283d12d5b61b2ac9b314c36...
Author: Rémi Bernon rbernon@codeweavers.com Date: Wed May 31 18:43:48 2023 +0200
win32u: Add a clipping_cursor member to user_thread_info.
---
dlls/win32u/input.c | 9 ++++++++- dlls/win32u/ntuser_private.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 2b951576c57..0dc166986f3 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -404,6 +404,7 @@ static const KBDTABLES kbdus_tables = .fLocaleFlags = MAKELONG(0, KBD_VERSION), };
+static LONG clipping_cursor; /* clipping thread counter */
LONG global_key_state_counter = 0; BOOL grab_pointer = TRUE; @@ -2504,6 +2505,9 @@ BOOL process_wine_clipcursor( BOOL empty, BOOL reset )
TRACE( "empty %u, reset %u\n", empty, reset );
+ if (thread_info->clipping_cursor) InterlockedDecrement( &clipping_cursor ); + thread_info->clipping_cursor = FALSE; + if (reset) { thread_info->clipping_reset = NtGetTickCount(); @@ -2514,7 +2518,10 @@ BOOL process_wine_clipcursor( BOOL empty, BOOL reset ) if (empty) return user_driver->pClipCursor( NULL, reset );
get_clip_cursor( &rect ); - return user_driver->pClipCursor( &rect, FALSE ); + if (!user_driver->pClipCursor( &rect, FALSE )) return FALSE; + InterlockedIncrement( &clipping_cursor ); + thread_info->clipping_cursor = TRUE; + return TRUE; }
/*********************************************************************** diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 88e644d2522..b39e38db5d6 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -130,6 +130,7 @@ struct user_thread_info UINT kbd_layout_id; /* Current keyboard layout ID */ struct rawinput_thread_data *rawinput; /* RawInput thread local data / buffer */ UINT spy_indent; /* Current spy indent */ + BOOL clipping_cursor; /* thread is currently clipping */ DWORD clipping_reset; /* time when clipping was last reset */ };