aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-02-11 13:34:12 +0100
committerKirill Primak <vyivel@eclair.cafe>2024-01-23 08:37:29 +0000
commit7a58f41416afe67e7b78b79cc297dabf8f20b533 (patch)
treeb6385926c0ac90dfa6fa8b74c389099a9d78cd07 /backend
parent00bb1b0f84991a100ae420ee413dd861c25c43fb (diff)
backend/libinput: populate pointer axis relative direction
Diffstat (limited to 'backend')
-rw-r--r--backend/libinput/pointer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c
index 711474fe..b124c663 100644
--- a/backend/libinput/pointer.c
+++ b/backend/libinput/pointer.c
@@ -129,6 +129,10 @@ void handle_pointer_axis(struct libinput_event *event,
wlr_event.delta_discrete =
libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]);
wlr_event.delta_discrete *= WLR_POINTER_AXIS_DISCRETE_STEP;
+ wlr_event.relative_direction = WLR_AXIS_RELATIVE_DIRECTION_IDENTICAL;
+ if (libinput_device_config_scroll_get_natural_scroll_enabled(libinput_event_get_device(event))) {
+ wlr_event.relative_direction = WLR_AXIS_RELATIVE_DIRECTION_INVERTED;
+ }
wl_signal_emit_mutable(&pointer->events.axis, &wlr_event);
}
wl_signal_emit_mutable(&pointer->events.frame, pointer);