Otherwise, two MK_RBUTTON messages become MK_SHIFT.
-- v2: server: Fix the accumulation method when merging WM_MOUSEWHEEL message.
From: Akihiro Sagawa sagawa.aki@gmail.com
--- server/queue.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/queue.c b/server/queue.c index 520659d377c..282523b21a3 100644 --- a/server/queue.c +++ b/server/queue.c @@ -823,11 +823,16 @@ static struct message *find_mouse_message( struct thread_input *input, const str static int merge_mousewheel( struct thread_input *input, const struct message *msg ) { struct message *prev; + int delta;
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 */ + /* accumulate wheel delta */ + delta = GET_WHEEL_DELTA_WPARAM(prev->wparam) + GET_WHEEL_DELTA_WPARAM(msg->wparam); + if (delta < MINSHORT || delta > MAXSHORT) return 0; + + prev->wparam = MAKEWPARAM(GET_KEYSTATE_WPARAM(msg->wparam), delta); prev->lparam = msg->lparam; prev->x = msg->x; prev->y = msg->y;