Module: wine Branch: master Commit: b04ef1993054a5e8dc3413beadf10150457a7b39 URL: https://gitlab.winehq.org/wine/wine/-/commit/b04ef1993054a5e8dc3413beadf1015...
Author: Rémi Bernon rbernon@codeweavers.com Date: Thu Dec 22 11:50:13 2022 +0100
server: Keep track of the current desktop cursor handle.
---
server/queue.c | 11 +++++++++++ server/user.h | 1 + 2 files changed, 12 insertions(+)
diff --git a/server/queue.c b/server/queue.c index 74462ebedee..7428685f94f 100644 --- a/server/queue.c +++ b/server/queue.c @@ -431,6 +431,11 @@ static int update_desktop_cursor_pos( struct desktop *desktop, user_handle_t win return updated; }
+static void update_desktop_cursor_handle( struct desktop *desktop, user_handle_t handle ) +{ + desktop->cursor.handle = handle; +} + /* set the cursor position and queue the corresponding mouse message */ static void set_cursor_pos( struct desktop *desktop, int x, int y ) { @@ -3356,6 +3361,12 @@ DECL_HANDLER(set_cursor) if (req->flags & SET_CURSOR_CLIP) set_clip_rectangle( desktop, &req->clip, 0 ); if (req->flags & SET_CURSOR_NOCLIP) set_clip_rectangle( desktop, NULL, 0 );
+ if (req->flags & (SET_CURSOR_HANDLE | SET_CURSOR_COUNT)) + { + if (input->cursor_count < 0) update_desktop_cursor_handle( desktop, 0 ); + else update_desktop_cursor_handle( desktop, input->cursor ); + } + reply->new_x = desktop->cursor.x; reply->new_y = desktop->cursor.y; reply->new_clip = desktop->cursor.clip; diff --git a/server/user.h b/server/user.h index a18c94ec89d..f67e710938f 100644 --- a/server/user.h +++ b/server/user.h @@ -59,6 +59,7 @@ struct global_cursor rectangle_t clip; /* cursor clip rectangle */ unsigned int last_change; /* time of last position change */ user_handle_t win; /* window that contains the cursor */ + user_handle_t handle; /* last set cursor handle */ };
struct desktop