From 5268ef349182f450c3662eadf765515e1199a8a7 Mon Sep 17 00:00:00 2001
From: marha <marha@users.sourceforge.net>
Date: Tue, 4 Aug 2009 15:54:21 +0000
Subject: Solved mouse wheel not behaving correctly (especially when there are
 multiple monitors)

---
 xorg-server/hw/xwin/winwndproc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'xorg-server')

diff --git a/xorg-server/hw/xwin/winwndproc.c b/xorg-server/hw/xwin/winwndproc.c
index da0f4f4e6..de6b26404 100644
--- a/xorg-server/hw/xwin/winwndproc.c
+++ b/xorg-server/hw/xwin/winwndproc.c
@@ -966,14 +966,19 @@ winWindowProc (HWND hwnd, UINT message,
       return 0;
 
     case WM_MOUSEWHEEL:
+    {
+      POINT Pos;
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
 #if CYGDEBUG
       winDebug ("winWindowProc - WM_MOUSEWHEEL\n");
 #endif
-      winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam),GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam));
+      Pos.x=GET_X_LPARAM(lParam);
+      Pos.y=GET_Y_LPARAM(lParam);
+      ScreenToClient(hwnd,&Pos);
+      winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam),Pos.x,Pos.y);
       break;
-
+    }
     case WM_SETFOCUS:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
-- 
cgit v1.2.3