Commit 994021da authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

server: Send WM_WINE_SETCURSOR message only when necessary.

parent 1604d8a2
......@@ -481,11 +481,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, struct thread_input *input )
static void update_desktop_cursor_handle( struct desktop *desktop, struct thread_input *input, user_handle_t handle )
{
if (input == get_desktop_cursor_thread_input( desktop ))
{
user_handle_t handle = input->cursor_count < 0 ? 0 : input->cursor, win = desktop->cursor.win;
user_handle_t win = desktop->cursor.win;
/* when clipping send the message to the foreground window as well, as some driver have an artificial overlay window */
if (is_cursor_clipped( desktop )) queue_cursor_message( desktop, 0, WM_WINE_SETCURSOR, win, handle );
queue_cursor_message( desktop, win, WM_WINE_SETCURSOR, win, handle );
......@@ -3636,12 +3636,14 @@ DECL_HANDLER(get_last_input_time)
DECL_HANDLER(set_cursor)
{
struct msg_queue *queue = get_current_queue();
user_handle_t prev_cursor, new_cursor;
struct thread_input *input;
struct desktop *desktop;
if (!queue) return;
input = queue->input;
desktop = input->desktop;
prev_cursor = input->cursor_count < 0 ? 0 : input->cursor;
reply->prev_handle = input->cursor;
reply->prev_count = input->cursor_count;
......@@ -3666,8 +3668,8 @@ DECL_HANDLER(set_cursor)
if (req->flags & SET_CURSOR_CLIP) set_clip_rectangle( desktop, &req->clip, req->flags, 0 );
if (req->flags & SET_CURSOR_NOCLIP) set_clip_rectangle( desktop, NULL, SET_CURSOR_NOCLIP, 0 );
if (req->flags & (SET_CURSOR_HANDLE | SET_CURSOR_COUNT))
update_desktop_cursor_handle( desktop, input );
new_cursor = input->cursor_count < 0 ? 0 : input->cursor;
if (prev_cursor != new_cursor) update_desktop_cursor_handle( desktop, input, new_cursor );
reply->new_x = desktop->cursor.x;
reply->new_y = desktop->cursor.y;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment