From: Jason Rumney Date: Wed, 26 Apr 2006 18:19:13 +0000 (+0000) Subject: (construct_mouse_wheel): Handle negative coordinates. X-Git-Tag: emacs-pretest-22.0.90~2941 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8b03732ee066a88a13db238aa84385c32c78e8b2;p=emacs.git (construct_mouse_wheel): Handle negative coordinates. --- diff --git a/src/ChangeLog b/src/ChangeLog index c47d5970fad..45b99584427 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2006-04-26 Jason Rumney + * w32term.c (construct_mouse_wheel): Handle negative coordinates. + * w32fns.c (w32_wnd_proc) : : Call signal_user_input in the cases where we preempt mouse_button_timer. diff --git a/src/w32term.c b/src/w32term.c index f0ef42f798b..2b5c9da39b6 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -3131,8 +3131,10 @@ construct_mouse_wheel (result, msg, f) result->modifiers = (msg->dwModifiers | ((delta < 0 ) ? down_modifier : up_modifier)); - p.x = LOWORD (msg->msg.lParam); - p.y = HIWORD (msg->msg.lParam); + /* With multiple monitors, we can legitimately get negative + coordinates, so cast to short to interpret them correctly. */ + p.x = (short) LOWORD (msg->msg.lParam); + p.y = (short) HIWORD (msg->msg.lParam); ScreenToClient (msg->msg.hwnd, &p); XSETINT (result->x, p.x); XSETINT (result->y, p.y);