summaryrefslogtreecommitdiff
path: root/driver/xf86-input-ws
diff options
context:
space:
mode:
authorAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-11-19 13:09:17 +0000
committerAlexandr Shadchin <shadchin@cvs.openbsd.org>2011-11-19 13:09:17 +0000
commit53fb1e8eb12d88319c5a739361a92c68a5a1b3b5 (patch)
treede90533f8bf8e8c51c34467ad46f5cfd67bb3334 /driver/xf86-input-ws
parent6c69b28d314ec7edf2ec2bacb49fe617c9503727 (diff)
Simplify middle button emulation code.
ok matthieu@
Diffstat (limited to 'driver/xf86-input-ws')
-rw-r--r--driver/xf86-input-ws/src/emumb.c18
-rw-r--r--driver/xf86-input-ws/src/ws.h1
2 files changed, 4 insertions, 15 deletions
diff --git a/driver/xf86-input-ws/src/emumb.c b/driver/xf86-input-ws/src/emumb.c
index 8886a4b34..5c14913d1 100644
--- a/driver/xf86-input-ws/src/emumb.c
+++ b/driver/xf86-input-ws/src/emumb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: emumb.c,v 1.8 2011/11/19 13:05:33 shadchin Exp $ */
+/* $OpenBSD: emumb.c,v 1.9 2011/11/19 13:09:16 shadchin Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
* Copyright 1993 by David Dawes <dawes@xfree86.org>
@@ -234,8 +234,9 @@ wsmbEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
if (!priv->emulateMB.enabled)
return ret;
- if (button == 2) {
- wsmbEmuEnable(pInfo, FALSE);
+ /* Disable emulation when middle button event is detected */
+ if (button == 2 && priv->emulateMB.enabled == MBEMU_AUTO) {
+ priv->emulateMB.enabled = FALSE;
return ret;
}
@@ -344,17 +345,6 @@ wsmbEmuFinalize(InputInfoPtr pInfo)
{
RemoveBlockAndWakeupHandlers(wsmbEmuBlockHandler,
wsmbEmuWakeupHandler, (pointer)pInfo);
-
-}
-
-/* Enable/disable middle mouse button emulation. */
-void
-wsmbEmuEnable(InputInfoPtr pInfo, BOOL enable)
-{
- WSDevicePtr priv = (WSDevicePtr)pInfo->private;
-
- if (priv->emulateMB.enabled == MBEMU_AUTO)
- priv->emulateMB.enabled = enable;
}
static int
diff --git a/driver/xf86-input-ws/src/ws.h b/driver/xf86-input-ws/src/ws.h
index 649c73975..05a506299 100644
--- a/driver/xf86-input-ws/src/ws.h
+++ b/driver/xf86-input-ws/src/ws.h
@@ -63,5 +63,4 @@ extern void wsmbEmuBlockHandler(pointer, struct timeval **, pointer);
extern void wsmbEmuPreInit(InputInfoPtr);
extern void wsmbEmuOn(InputInfoPtr);
extern void wsmbEmuFinalize(InputInfoPtr);
-extern void wsmbEmuEnable(InputInfoPtr, BOOL);
extern void wsmbEmuInitProperty(DeviceIntPtr);