{
struct normalized_coords wheel_degrees = { 0.0, 0.0 };
struct discrete_coords discrete = { 0.0, 0.0 };
- enum libinput_pointer_axis_source source;
if (!(device->seat_caps & EVDEV_DEVICE_POINTER))
return;
device->scroll.wheel_click_angle.y;
discrete.y = -1 * dispatch->wheel.y;
- source = device->scroll.is_tilt.vertical ?
- LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT:
- LIBINPUT_POINTER_AXIS_SOURCE_WHEEL;
-
evdev_notify_axis(
device,
time,
bit(LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL),
- source,
+ LIBINPUT_POINTER_AXIS_SOURCE_WHEEL,
&wheel_degrees,
&discrete);
dispatch->wheel.y = 0;
device->scroll.wheel_click_angle.x;
discrete.x = dispatch->wheel.x;
- source = device->scroll.is_tilt.horizontal ?
- LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT:
- LIBINPUT_POINTER_AXIS_SOURCE_WHEEL;
-
evdev_notify_axis(
device,
time,
bit(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL),
- source,
+ LIBINPUT_POINTER_AXIS_SOURCE_WHEEL,
&wheel_degrees,
&discrete);
dispatch->wheel.x = 0;
return angles;
}
-static inline struct wheel_tilt_flags
-evdev_read_wheel_tilt_props(struct evdev_device *device)
-{
- struct wheel_tilt_flags flags;
-
- flags.vertical = parse_udev_flag(device,
- device->udev_device,
- "MOUSE_WHEEL_TILT_VERTICAL");
-
- flags.horizontal = parse_udev_flag(device,
- device->udev_device,
- "MOUSE_WHEEL_TILT_HORIZONTAL");
- return flags;
-}
-
static inline double
evdev_get_trackpoint_multiplier(struct evdev_device *device)
{
device->scroll.direction = 0;
device->scroll.wheel_click_angle =
evdev_read_wheel_click_props(device);
- device->scroll.is_tilt = evdev_read_wheel_tilt_props(device);
device->model_flags = evdev_read_model_flags(device);
device->dpi = DEFAULT_MOUSE_DPI;
/* angle per REL_WHEEL click in degrees */
struct wheel_angle wheel_click_angle;
- struct wheel_tilt_flags is_tilt;
-
enum evdev_button_scroll_lock_state lock_state;
bool want_lock_enabled;
bool lock_enabled;
double minor;
};
-/* A pair of tilt flags */
-struct wheel_tilt_flags {
- bool vertical, horizontal;
-};
-
struct libinput_interface_backend {
int (*resume)(struct libinput *libinput);
void (*suspend)(struct libinput *libinput);
* The event is caused by the tilting of a mouse wheel rather than
* its rotation. This method is commonly used on mice without
* separate horizontal scroll wheels.
+ *
+ * @deprecated This axis source is deprecated as of libinput 1.16.
+ * It was never used by any device before libinput 1.16. All wheel
+ * tilt devices use @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL instead.
*/
LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT,
};
* The coordinate system is identical to the cursor movement, i.e. a
* scroll value of 1 represents the equivalent relative motion of 1.
*
- * If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT, no
- * terminating event is guaranteed (though it may happen).
- * Scrolling is in discrete steps and there is no physical equivalent for
- * the value returned here. For backwards compatibility, the value returned
- * by this function is identical to a single mouse wheel rotation by this
- * device (see the documentation for @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL
- * above). Callers should not use this value but instead exclusively refer
- * to the value returned by libinput_event_pointer_get_axis_value_discrete().
+ * @deprecated The source @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT is
+ * deprecated as of libinput 1.16. No device has ever sent this source.
*
* For pointer events that are not of type @ref LIBINPUT_EVENT_POINTER_AXIS,
* this function returns 0.
return angle;
}
-static enum libinput_pointer_axis_source
-wheel_source(struct litest_device *dev, int which)
-{
- struct udev_device *d;
- bool is_tilt = false;
-
- d = libinput_device_get_udev_device(dev->libinput_device);
- litest_assert_ptr_notnull(d);
-
- switch(which) {
- case REL_WHEEL:
- is_tilt = !!udev_device_get_property_value(d, "MOUSE_WHEEL_TILT_VERTICAL");
- break;
- case REL_HWHEEL:
- is_tilt = !!udev_device_get_property_value(d, "MOUSE_WHEEL_TILT_HORIZONTAL");
- break;
- default:
- litest_abort_msg("Invalid source axis %d\n", which);
- break;
- }
-
- udev_device_unref(d);
- return is_tilt ?
- LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT :
- LIBINPUT_POINTER_AXIS_SOURCE_WHEEL;
-}
-
static void
test_wheel_event(struct litest_device *dev, int which, int amount)
{
double scroll_step, expected, discrete;
scroll_step = wheel_click_angle(dev, which);
- source = wheel_source(dev, which);
+ source = LIBINPUT_POINTER_AXIS_SOURCE_WHEEL;
expected = amount * scroll_step;
discrete = amount;