Alexandre Julliard : dinput: Filter out mouse wheel messages in exclusive mode.
Alexandre Julliard
julliard at winehq.org
Wed Feb 15 13:14:05 CST 2012
Module: wine
Branch: master
Commit: 011a3523aa2921c03766155e8669e08db4a6989f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=011a3523aa2921c03766155e8669e08db4a6989f
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Feb 15 19:13:34 2012 +0100
dinput: Filter out mouse wheel messages in exclusive mode.
---
dlls/dinput/mouse.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index f78ae23..7cac0fc 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -319,7 +319,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM
{
MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam;
SysMouseImpl* This = impl_from_IDirectInputDevice8A(iface);
- int wdata = 0, inst_id = -1;
+ int wdata = 0, inst_id = -1, ret = 0;
TRACE("msg %lx @ (%d %d)\n", wparam, hook->pt.x, hook->pt.y);
@@ -367,6 +367,9 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM
case WM_MOUSEWHEEL:
inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Z_AXIS_INSTANCE) | DIDFT_RELAXIS;
This->m_state.lZ += wdata = (short)HIWORD(hook->mouseData);
+ /* FarCry crashes if it gets a mouse wheel message */
+ /* FIXME: should probably filter out other messages too */
+ ret = This->clipped;
break;
case WM_LBUTTONDOWN:
inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_BUTTONS_INSTANCE + 0) | DIDFT_PSHBUTTON;
@@ -411,7 +414,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM
}
LeaveCriticalSection(&This->base.crit);
- return 0;
+ return ret;
}
static void warp_check( SysMouseImpl* This, BOOL force )
More information about the wine-cvs
mailing list