From: "Anna (navi) Figueiredo Gomes" <navi@vlhl.dev> Seems like pointerId 1 is always the mouse, regardless of EnableMouseInPointer. --- dlls/win32u/input.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 9f44ebf060a..5037200a480 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2868,36 +2868,47 @@ INT WINAPI NtUserScheduleDispatchNotification( HWND hwnd ) return 0; } +static struct pointer *allocate_pointerid( UINT32 id ); + static struct pointer_thread_data *get_pointer_thread_data(void) { struct user_thread_info *thread_info = get_user_thread_info(); if (!thread_info->pointer_data && (thread_info->pointer_data = calloc( 1, sizeof(*thread_info->pointer_data) ))) + { list_init( &thread_info->pointer_data->known_pointers ); + allocate_pointerid( 1 ); + } return thread_info->pointer_data; }; -static struct pointer *find_pointerid(UINT32 id) +static struct pointer *allocate_pointerid( UINT32 id ) { struct pointer_thread_data *thread_data = get_pointer_thread_data(); struct pointer *pointer; - TRACE( "looking for pointer id %d\n", id ); - - LIST_FOR_EACH_ENTRY(pointer, &thread_data->known_pointers, struct pointer, entry) - if (pointer->id == id) - return pointer; - TRACE( "allocating pointer id %d\n", id ); if (!thread_data || !(pointer = calloc( 1, sizeof(*pointer) ))) return NULL; - pointer->id = id; list_add_tail( &thread_data->known_pointers, &pointer->entry ); return pointer; } +static struct pointer *find_pointerid( UINT32 id ) { + struct pointer_thread_data *thread_data = get_pointer_thread_data(); + struct pointer *pointer; + + TRACE( "looking for pointer id %d\n", id ); + + LIST_FOR_EACH_ENTRY(pointer, &thread_data->known_pointers, struct pointer, entry) + if (pointer->id == id) + return pointer; + + return allocate_pointerid( id ); +} + static POINT pixel_to_himetric( POINT px ) { UINT dpi = HIMETRIC / get_system_dpi(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10649