evdev: Pass axis parameters when notifying absolute motion events

This will be useful for tablet support, NULL is given in the current
callers.
This commit is contained in:
Carlos Garnacho 2015-01-09 17:10:11 +01:00
parent 40a5eff5d4
commit fe59da43ef

View File

@ -430,7 +430,8 @@ static ClutterEvent *
new_absolute_motion_event (ClutterInputDevice *input_device, new_absolute_motion_event (ClutterInputDevice *input_device,
guint64 time_us, guint64 time_us,
gfloat x, gfloat x,
gfloat y) gfloat y,
gdouble *axes)
{ {
gfloat stage_width, stage_height; gfloat stage_width, stage_height;
ClutterDeviceManagerEvdev *manager_evdev; ClutterDeviceManagerEvdev *manager_evdev;
@ -471,6 +472,7 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state); _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x; event->motion.x = x;
event->motion.y = y; event->motion.y = y;
event->motion.axes = axes;
clutter_event_set_device (event, seat->core_pointer); clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device); clutter_event_set_source_device (event, input_device);
@ -486,11 +488,12 @@ static void
notify_absolute_motion (ClutterInputDevice *input_device, notify_absolute_motion (ClutterInputDevice *input_device,
guint64 time_us, guint64 time_us,
gfloat x, gfloat x,
gfloat y) gfloat y,
gdouble *axes)
{ {
ClutterEvent *event; ClutterEvent *event;
event = new_absolute_motion_event (input_device, time_us, x, y); event = new_absolute_motion_event (input_device, time_us, x, y, axes);
queue_event (event); queue_event (event);
} }
@ -523,7 +526,7 @@ notify_relative_motion (ClutterInputDevice *input_device,
new_y = seat->pointer_y + dy; new_y = seat->pointer_y + dy;
time_us = libinput_event_pointer_get_time_usec (pointer_event); time_us = libinput_event_pointer_get_time_usec (pointer_event);
event = new_absolute_motion_event (input_device, time_us, new_x, new_y); event = new_absolute_motion_event (input_device, time_us, new_x, new_y, NULL);
dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event); dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event);
dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event); dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event);
@ -1500,7 +1503,7 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
stage_width); stage_width);
y = libinput_event_pointer_get_absolute_y_transformed (motion_event, y = libinput_event_pointer_get_absolute_y_transformed (motion_event,
stage_height); stage_height);
notify_absolute_motion (device, time_us, x, y); notify_absolute_motion (device, time_us, x, y, NULL);
break; break;
} }
@ -2604,5 +2607,5 @@ clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
int x, int x,
int y) int y)
{ {
notify_absolute_motion (pointer_device, ms2us(time_), x, y); notify_absolute_motion (pointer_device, ms2us(time_), x, y, NULL);
} }