wacom: Update from gnome-settings-daemon

This commit is contained in:
Bastien Nocera 2012-02-22 12:53:57 +01:00
parent 0bd22ad94e
commit b0275d53e9
2 changed files with 11 additions and 4 deletions

View file

@ -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 ||

View file

@ -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);