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.
This commit is contained in:
parent
0e8eedee16
commit
05df57654f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user