[PATCH v3 0/1] MR7736: server: Fix the accumulation method when merging WM_MOUSEWHEEL message.
Otherwise, two MK_RBUTTON messages become MK_SHIFT. -- v3: server: Fix the accumulation method when merging WM_MOUSEWHEEL message. https://gitlab.winehq.org/wine/wine/-/merge_requests/7736
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- server/queue.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/queue.c b/server/queue.c index 520659d377c..b4b6069f927 100644 --- a/server/queue.c +++ b/server/queue.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include <unistd.h> #include <poll.h> +#include <limits.h> #include "ntstatus.h" #define WIN32_NO_STATUS @@ -823,11 +824,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 < SHRT_MIN || delta > SHRT_MAX) return 0; + + prev->wparam = MAKEWPARAM(GET_KEYSTATE_WPARAM(msg->wparam), delta); prev->lparam = msg->lparam; prev->x = msg->x; prev->y = msg->y; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7736
In v3, fix the build error. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7736#note_100007
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7736
participants (3)
-
Akihiro Sagawa -
Akihiro Sagawa (@sgwaki) -
Rémi Bernon