From: Rémi Bernon rbernon@codeweavers.com
--- server/queue.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 8839b0e47f1..770ed72ce43 100644 --- a/server/queue.c +++ b/server/queue.c @@ -405,6 +405,8 @@ static struct message *alloc_hardware_message( lparam_t info, struct hw_msg_sour
static int update_desktop_cursor_pos( struct desktop *desktop, user_handle_t win, int x, int y ) { + struct thread_input *input; + struct thread *thread; int updated;
x = max( min( x, desktop->cursor.clip.right - 1 ), desktop->cursor.clip.left ); @@ -414,6 +416,21 @@ static int update_desktop_cursor_pos( struct desktop *desktop, user_handle_t win desktop->cursor.y = y; desktop->cursor.last_change = get_tick_count();
+ if (win && (thread = get_window_thread( win ))) + { + input = thread->queue->input; + release_object( thread ); + } + else input = desktop->foreground_input; + + if (input && input->capture) + win = input->capture; + else if (!win || !is_window_visible( win ) || is_window_transparent( win )) + win = shallow_window_from_point( desktop, x, y ); + + if (win != desktop->cursor.win) updated = 1; + desktop->cursor.win = win; + return updated; }
@@ -1503,7 +1520,7 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru struct message *msg, unsigned int *msg_code, struct thread **thread ) { - user_handle_t win = 0; + user_handle_t win = desktop->cursor.win;
*thread = NULL; *msg_code = msg->msg; @@ -1519,11 +1536,8 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru if (*msg_code < WM_SYSKEYDOWN) *msg_code += WM_SYSKEYDOWN - WM_KEYDOWN; } } - else if (!input || !(win = input->capture)) /* mouse message */ + else if (!input || !input->capture) /* mouse message */ { - if (is_window_visible( msg->win ) && !is_window_transparent( msg->win )) win = msg->win; - else win = shallow_window_from_point( desktop, msg->x, msg->y ); - *thread = window_thread_from_point( win, msg->x, msg->y ); }
@@ -1609,9 +1623,6 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg } input = thread->queue->input;
- if (win != desktop->cursor.win) always_queue = 1; - desktop->cursor.win = win; - if (!always_queue || merge_message( input, msg )) free_message( msg ); else {