changeset 70234:4282b2a1849b

(construct_mouse_wheel): Handle negative coordinates.
author Jason Rumney <jasonr@gnu.org>
date Wed, 26 Apr 2006 18:18:08 +0000
parents 589489bb1924
children f90c5558879e
files src/w32term.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Wed Apr 26 17:54:41 2006 +0000
+++ b/src/w32term.c	Wed Apr 26 18:18:08 2006 +0000
@@ -3131,8 +3131,10 @@
   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);