diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-12-15 08:39:56 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-12-23 09:59:35 +1000 |
commit | 0319ee1d3316393c4cb0d551445529bfee415a1a (patch) | |
tree | e65ee57b7ae33dde66aca1d17326932f369977a0 /src/evdev-tablet.c | |
parent | 67e0b232a037572b83a5c752a258fdbd9003d0b3 (diff) |
tablet: split sanitize_tablet_axes up into two helpers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-tablet.c')
-rw-r--r-- | src/evdev-tablet.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index 3834e56..7804c91 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -957,7 +957,7 @@ tablet_notify_buttons(struct tablet_dispatch *tablet, } static void -sanitize_tablet_axes(struct tablet_dispatch *tablet) +sanitize_pressure_distance(struct tablet_dispatch *tablet) { bool tool_in_contact; const struct input_absinfo *distance, @@ -995,7 +995,11 @@ sanitize_tablet_axes(struct tablet_dispatch *tablet) else tablet->axes[LIBINPUT_TABLET_TOOL_AXIS_PRESSURE] = 0; } +} +static inline void +sanitize_mouse_lens_rotation(struct tablet_dispatch *tablet) +{ /* If we have a mouse/lens cursor and the tilt changed, the rotation changed. Mark this, calculate the angle later */ if ((tablet->current_tool_type == LIBINPUT_TABLET_TOOL_TYPE_MOUSE || @@ -1012,6 +1016,13 @@ axis_range_percentage(const struct input_absinfo *a, int percent) } static void +sanitize_tablet_axes(struct tablet_dispatch *tablet) +{ + sanitize_pressure_distance(tablet); + sanitize_mouse_lens_rotation(tablet); +} + +static void detect_pressure_offset(struct tablet_dispatch *tablet, struct evdev_device *device, struct libinput_tablet_tool *tool) |