From 05df57654f5f6bbeae9bfc2c274c772a5778e603 Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Tue, 19 May 2020 16:41:16 +0200 Subject: [PATCH] testinput: we must get the source of the source device The tablet device is the source device of the event. We must use the source device to properly detect what kind of source we must use to properly set the color. --- tests/testinput.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testinput.c b/tests/testinput.c index 57a9e4f41f..b68552a428 100644 --- a/tests/testinput.c +++ b/tests/testinput.c @@ -194,7 +194,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event) print_axes (event->device, event->axes); gdk_event_get_axis ((GdkEvent *)event, GDK_AXIS_PRESSURE, &pressure); - draw_brush (widget, gdk_device_get_source (event->device), + draw_brush (widget, gdk_device_get_source (gdk_event_get_source_device (event)), event->x, event->y, pressure); motion_time = event->time; @@ -239,10 +239,10 @@ motion_notify_event (GtkWidget *widget, GdkEventMotion *event) gdk_device_get_axis (event->device, events[i]->axes, GDK_AXIS_X, &x); gdk_device_get_axis (event->device, events[i]->axes, GDK_AXIS_Y, &y); gdk_device_get_axis (event->device, events[i]->axes, GDK_AXIS_PRESSURE, &pressure); - draw_brush (widget, gdk_device_get_source (event->device), + draw_brush (widget, gdk_device_get_source (gdk_event_get_source_device (event)), x, y, pressure); - print_axes (event->device, events[i]->axes); + print_axes (gdk_event_get_source_device (event), events[i]->axes); } gdk_device_free_history (events, n_events); } @@ -252,7 +252,7 @@ motion_notify_event (GtkWidget *widget, GdkEventMotion *event) gdk_event_get_axis ((GdkEvent *)event, GDK_AXIS_PRESSURE, &pressure); - draw_brush (widget, gdk_device_get_source (event->device), + draw_brush (widget, gdk_device_get_source (gdk_event_get_source_device (event)), event->x, event->y, pressure); } motion_time = event->time;