[gnome-settings-daemon] wacom: Add support for current tool ID from wacom driver
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Add support for current tool ID from wacom driver
- Date: Wed, 22 Feb 2012 12:13:06 +0000 (UTC)
commit 6557fd3c71a7f757832d2c2cd6c64442331b36cf
Author: Bastien Nocera <hadess hadess net>
Date: Wed Feb 22 12:47:38 2012 +0100
wacom: Add support for current tool ID from wacom driver
plugins/common/gsd-input-helper.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index 36eb78e..95b1b38 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -341,7 +341,7 @@ xdevice_get_last_tool_id (int deviceid)
if (gdk_error_trap_pop ())
goto out;
- if (nitems != 4)
+ if (nitems != 4 && nitems != 5)
goto out;
if (act_type != XA_INTEGER)
@@ -353,8 +353,15 @@ xdevice_get_last_tool_id (int deviceid)
/* item 0 = tablet ID
* item 1 = old device serial number (== last tool in proximity)
* item 2 = old hardware serial number (including tool ID)
- * item 3 = current serial number (0 if no tool in proximity) */
- id = get_id_for_index (data, 2);
+ * item 3 = current serial number (0 if no tool in proximity)
+ * item 4 = current tool ID (since Feb 2012)
+ *
+ * Get the current tool ID first, if available, then the old one */
+ id = 0x0;
+ if (nitems == 5)
+ id = get_id_for_index (data, 4);
+ if (id == 0x0)
+ id = get_id_for_index (data, 2);
/* That means that no tool was set down yet */
if (id == STYLUS_DEVICE_ID ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]