[gnome-control-center] wacom: Update from gnome-settings-daemon
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] wacom: Update from gnome-settings-daemon
- Date: Wed, 22 Feb 2012 12:13:54 +0000 (UTC)
commit b0275d53e9d90906381b4533ec03d678c8b6c19b
Author: Bastien Nocera <hadess hadess net>
Date: Wed Feb 22 12:53:57 2012 +0100
wacom: Update from gnome-settings-daemon
panels/wacom/gsd-input-helper.c | 13 ++++++++++---
panels/wacom/gsd-wacom-device.c | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/panels/wacom/gsd-input-helper.c b/panels/wacom/gsd-input-helper.c
index 36eb78e..95b1b38 100644
--- a/panels/wacom/gsd-input-helper.c
+++ b/panels/wacom/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 ||
diff --git a/panels/wacom/gsd-wacom-device.c b/panels/wacom/gsd-wacom-device.c
index 73def1c..e7507a2 100644
--- a/panels/wacom/gsd-wacom-device.c
+++ b/panels/wacom/gsd-wacom-device.c
@@ -374,7 +374,7 @@ filter_events (XEvent *xevent,
tool_id = xdevice_get_last_tool_id (device->priv->device_id);
if (tool_id == -1) {
- g_warning ("Failed to get value for changed stylus ID on device '%d", device->priv->device_id);
+ g_warning ("Failed to get value for changed stylus ID on device '%d'", device->priv->device_id);
return GDK_FILTER_CONTINUE;
}
gsd_wacom_device_set_current_stylus (device, tool_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]