summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2003-09-28 15:23:54 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:01:13 +0200
commit8c8177561c7baa0f2d0b3b974f67aa85b4f73c09 (patch)
tree8516b2419bc467a5514a3ab657e8a235ab1b52ec
parente3413da67be91dd32e01e6eb8918101eb4f25361 (diff)
When using the Linux 2.6 event device, try to get exclusive
access to the device, so that touchpad data doesn't leak to /dev/input/mice.
-rw-r--r--linux_input.h1
-rw-r--r--synaptics.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/linux_input.h b/linux_input.h
index 9e8c487..c5b70e8 100644
--- a/linux_input.h
+++ b/linux_input.h
@@ -25,6 +25,7 @@ struct input_id {
};
#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
+#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
#define EV_SYN 0x00
diff --git a/synaptics.c b/synaptics.c
index 72e34b9..56b38c8 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -478,6 +478,16 @@ DeviceOn (DeviceIntPtr dev)
return !Success;
}
+ /* Try to grab the event device so that data doesn't leak to /dev/input/mice */
+ if (priv->proto == SYN_PROTO_EVENT) {
+ int ret;
+ SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1));
+ if (ret < 0) {
+ xf86Msg(X_WARNING, "%s can't grab event device\n",
+ local->name, errno);
+ }
+ }
+
priv->buffer = XisbNew(local->fd, 64);
if (!priv->buffer) {
xf86CloseSerial(local->fd);