wacom: Fix device filtering in calibration UI

We receive ClutterEvents, not GdkEvents for button presses on
ClutterActors, so use the correct functions to filter devices.

This also fixes the offset used to access the coordinates of the
events. We were actually using the pointer to the source and x
struct members instead of x and y.

https://bugzilla.gnome.org/show_bug.cgi?id=707784
This commit is contained in:
Bastien Nocera 2013-10-04 11:05:27 +02:00
parent 387e3f98f7
commit 55744f6544

View file

@ -304,10 +304,10 @@ on_button_press_event(ClutterActor *actor,
/* Check matching device ID if a device ID was provided */ /* Check matching device ID if a device ID was provided */
if (area->device_id > -1) if (area->device_id > -1)
{ {
GdkDevice *device; ClutterInputDevice *device;
device = gdk_event_get_source_device ((GdkEvent *) event); device = ((ClutterButtonEvent *) event)->device;
if (device != NULL && gdk_x11_device_get_id (device) != area->device_id) if (device != NULL && clutter_input_device_get_device_id (device) != area->device_id)
return FALSE; return FALSE;
} }