# HG changeset patch # User Jason Rumney # Date 1146075488 0 # Node ID 4282b2a1849b09a763dce52a741fe45f1222b4d4 # Parent 589489bb1924c00ece7a3c214794e23b8462aad1 (construct_mouse_wheel): Handle negative coordinates. diff -r 589489bb1924 -r 4282b2a1849b src/w32term.c --- 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);