From: Rémi Bernon rbernon@codeweavers.com
--- server/queue.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/server/queue.c b/server/queue.c index a918540c128..74a28e89368 100644 --- a/server/queue.c +++ b/server/queue.c @@ -799,8 +799,8 @@ static inline unsigned int get_unique_id(void) return id; }
-/* try to merge a WM_MOUSEMOVE message with the last in the list; return 1 if successful */ -static int merge_mousemove( struct thread_input *input, const struct message *msg ) +/* lookup an already queued mouse message that matches the message, window and type */ +static struct message *find_mouse_message( struct thread_input *input, const struct message *msg ) { struct message *prev; struct list *ptr; @@ -811,12 +811,21 @@ static int merge_mousemove( struct thread_input *input, const struct message *ms if (prev->msg >> 31) continue; /* ignore internal messages */ if (prev->msg != WM_INPUT) break; } - if (!ptr) return 0; - if (prev->result) return 0; - if (prev->win && msg->win && prev->win != msg->win) return 0; - if (prev->msg != msg->msg) return 0; - if (prev->type != msg->type) return 0; - /* now we can merge it */ + if (!ptr) return NULL; + if (prev->result) return NULL; + if (prev->win && msg->win && prev->win != msg->win) return NULL; + if (prev->msg != msg->msg) return NULL; + if (prev->type != msg->type) return NULL; + return prev; +} + +/* try to merge a WM_MOUSEMOVE message with the last in the list; return 1 if successful */ +static int merge_mousemove( struct thread_input *input, const struct message *msg ) +{ + struct message *prev; + + if (!(prev = find_mouse_message( input, msg ))) return 0; + prev->wparam = msg->wparam; prev->lparam = msg->lparam; prev->x = msg->x; @@ -828,8 +837,8 @@ static int merge_mousemove( struct thread_input *input, const struct message *ms struct hardware_msg_data *msg_data = msg->data; prev_data->info = msg_data->info; } - list_remove( ptr ); - list_add_tail( &input->msg_list, ptr ); + list_remove( &prev->entry ); + list_add_tail( &input->msg_list, &prev->entry ); return 1; }
From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- server/queue.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/server/queue.c b/server/queue.c index 74a28e89368..520659d377c 100644 --- a/server/queue.c +++ b/server/queue.c @@ -819,6 +819,30 @@ static struct message *find_mouse_message( struct thread_input *input, const str return prev; }
+/* try to merge a WM_MOUSEWHEEL message with the last in the list; return 1 if successful */ +static int merge_mousewheel( struct thread_input *input, const struct message *msg ) +{ + struct message *prev; + + if (!(prev = find_mouse_message( input, msg ))) return 0; + if (prev->x != msg->x || prev->y != msg->y) return 0; /* don't merge if cursor has moved */ + + prev->wparam += msg->wparam; /* accumulate wheel delta */ + prev->lparam = msg->lparam; + prev->x = msg->x; + prev->y = msg->y; + prev->time = msg->time; + if (msg->type == MSG_HARDWARE && prev->data && msg->data) + { + struct hardware_msg_data *prev_data = prev->data; + struct hardware_msg_data *msg_data = msg->data; + prev_data->info = msg_data->info; + } + list_remove( &prev->entry ); + list_add_tail( &input->msg_list, &prev->entry ); + return 1; +} + /* try to merge a WM_MOUSEMOVE message with the last in the list; return 1 if successful */ static int merge_mousemove( struct thread_input *input, const struct message *msg ) { @@ -870,6 +894,7 @@ static int merge_unique_message( struct thread_input *input, unsigned int messag /* try to merge a message with the messages in the list; return 1 if successful */ static int merge_message( struct thread_input *input, const struct message *msg ) { + if (msg->msg == WM_MOUSEWHEEL) return merge_mousewheel( input, msg ); if (msg->msg == WM_MOUSEMOVE) return merge_mousemove( input, msg ); if (msg->msg == WM_WINE_CLIPCURSOR) return merge_unique_message( input, WM_WINE_CLIPCURSOR, msg ); if (msg->msg == WM_WINE_SETCURSOR) return merge_unique_message( input, WM_WINE_SETCURSOR, msg );
This merge request was approved by Rémi Bernon.