[gnome-settings-daemon] wacom: Return 0x0 when no tool has touched the tablet
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Return 0x0 when no tool has touched the tablet
- Date: Wed, 14 Dec 2011 18:56:52 +0000 (UTC)
commit d1c150989256a83af7277b994c37af2ecbad1e51
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 14 18:17:57 2011 +0000
wacom: Return 0x0 when no tool has touched the tablet
plugins/common/gsd-input-helper.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index f06882e..3653ef1 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -289,6 +289,9 @@ out:
return NULL;
}
+#define STYLUS_DEVICE_ID 0x02
+#define ERASER_DEVICE_ID 0x0A
+
int
xdevice_get_last_tool_id (int deviceid)
{
@@ -339,6 +342,11 @@ xdevice_get_last_tool_id (int deviceid)
id = *((int32_t*)ptr);
id = id & 0xfffff;
+ /* That means that no tool was set down yet */
+ if (id == STYLUS_DEVICE_ID ||
+ id == ERASER_DEVICE_ID)
+ return 0x0;
+
out:
XFree (data);
return id;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]