From 61b4e88e01f32e976f85e7970a7f5b21fcd84f97 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 21 Sep 2009 16:56:28 +1000 Subject: emuWheel: fix signed/unsigned screwup This patch fixes wheel emulation on buttons other than 0. Reported-by: Andy Neitzke Signed-off-by: Peter Hutterer --- src/emuWheel.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/emuWheel.c b/src/emuWheel.c index 178b01b..e7b2f98 100644 --- a/src/emuWheel.c +++ b/src/emuWheel.c @@ -110,9 +110,11 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv) */ if (pEvdev->emulateWheel.button_state || !pEvdev->emulateWheel.button) { /* Just return if the timeout hasn't expired yet */ - if (pEvdev->emulateWheel.button && - pEvdev->emulateWheel.expires - GetTimeInMillis() > 0) { - return TRUE; + if (pEvdev->emulateWheel.button) + { + int ms = pEvdev->emulateWheel.expires - GetTimeInMillis(); + if (ms > 0) + return TRUE; } /* We don't want to intercept real mouse wheel events */ -- cgit v1.2.3