aboutsummaryrefslogtreecommitdiffstats
path: root/src/mtouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mtouch.c')
-rw-r--r--src/mtouch.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/mtouch.c b/src/mtouch.c
index cb1c44c..6952611 100644
--- a/src/mtouch.c
+++ b/src/mtouch.c
@@ -20,28 +20,17 @@ int open_mtouch(struct MTouch *mt, int fd)
init_hwdata(&mt->hw);
init_state(&mt->os);
init_state(&mt->ns);
- if (mt->grabbed)
- return 0;
SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)1));
- if (rc < 0) {
- xf86Msg(X_WARNING, "multitouch: cannot grab device\n");
- return rc;
- }
- mt->grabbed = 1;
- return 0;
+ return rc;
}
/******************************************************/
-void close_mtouch(struct MTouch *mt, int fd)
+int close_mtouch(struct MTouch *mt, int fd)
{
int rc;
- if (!mt->grabbed)
- return;
SYSCALL(rc = ioctl(fd, EVIOCGRAB, (pointer)0));
- if (rc < 0)
- xf86Msg(X_WARNING, "multitouch: cannot ungrab device\n");
- mt->grabbed = 0;
+ return rc;
}
/******************************************************/