libinput-device: use the new merged scroll events
libinput now provides a single event for scroll events. Extract the axes from that event and split them into the wl events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
committed by
Jonas Ådahl
parent
fd5ca513f9
commit
c54f23d8df
+20
-5
@@ -133,12 +133,27 @@ handle_pointer_axis(struct libinput_device *libinput_device,
|
|||||||
struct evdev_device *device =
|
struct evdev_device *device =
|
||||||
libinput_device_get_user_data(libinput_device);
|
libinput_device_get_user_data(libinput_device);
|
||||||
double value;
|
double value;
|
||||||
|
enum libinput_pointer_axis axis;
|
||||||
|
|
||||||
value = libinput_event_pointer_get_axis_value(pointer_event);
|
axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
|
||||||
notify_axis(device->seat,
|
if (libinput_event_pointer_has_axis(pointer_event, axis)) {
|
||||||
libinput_event_pointer_get_time(pointer_event),
|
value = libinput_event_pointer_get_axis_value(pointer_event,
|
||||||
libinput_event_pointer_get_axis(pointer_event),
|
axis);
|
||||||
wl_fixed_from_double(value));
|
notify_axis(device->seat,
|
||||||
|
libinput_event_pointer_get_time(pointer_event),
|
||||||
|
WL_POINTER_AXIS_VERTICAL_SCROLL,
|
||||||
|
wl_fixed_from_double(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
|
||||||
|
if (libinput_event_pointer_has_axis(pointer_event, axis)) {
|
||||||
|
value = libinput_event_pointer_get_axis_value(pointer_event,
|
||||||
|
axis);
|
||||||
|
notify_axis(device->seat,
|
||||||
|
libinput_event_pointer_get_time(pointer_event),
|
||||||
|
WL_POINTER_AXIS_HORIZONTAL_SCROLL,
|
||||||
|
wl_fixed_from_double(value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user