server: Keep track of the current desktop cursor handle.

This commit is contained in:
Rémi Bernon 2022-12-22 11:50:13 +01:00 committed by Alexandre Julliard
parent 10f5ff7f06
commit b04ef19930
2 changed files with 12 additions and 0 deletions

View file

@ -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;

View file

@ -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