diff options
author | emersion <contact@emersion.fr> | 2018-05-12 13:04:47 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-05-12 13:34:58 +0100 |
commit | 0b585795645f608093ae59199a71bf5be6790e3b (patch) | |
tree | 49a5c786435f30cdeb6aa8900bb9118079a60395 /backend/x11/input_device.c | |
parent | 84609d347a6c943096335ac5c96af133c782e179 (diff) |
Add support for discrete axis values
Diffstat (limited to 'backend/x11/input_device.c')
-rw-r--r-- | backend/x11/input_device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c index 75cfa76e..a16da1c9 100644 --- a/backend/x11/input_device.c +++ b/backend/x11/input_device.c @@ -73,13 +73,15 @@ void handle_x11_input_event(struct wlr_x11_backend *x11, if (ev->detail == XCB_BUTTON_INDEX_4 || ev->detail == XCB_BUTTON_INDEX_5) { - double delta = (ev->detail == XCB_BUTTON_INDEX_4 ? -15 : 15); + int32_t delta_discrete = ev->detail == XCB_BUTTON_INDEX_4 ? -1 : 1; struct wlr_event_pointer_axis axis = { .device = &output->pointer_dev, .time_msec = ev->time, .source = WLR_AXIS_SOURCE_WHEEL, .orientation = WLR_AXIS_ORIENTATION_VERTICAL, - .delta = delta, + // 15 is a typical value libinput sends for one scroll + .delta = delta_discrete * 15, + .delta_discrete = delta_discrete, }; wlr_signal_emit_safe(&output->pointer.events.axis, &axis); x11->time = ev->time; |