bar/wayland: fix mouse wheel up not being emitted

We emit mouse wheel up events when the ‘discrete’ counter is
negative. Thus, when looping, we need to loop to its *absolute* value.
This commit is contained in:
Daniel Eklöf 2021-06-23 11:21:26 +02:00
parent 46e6539b1a
commit 4ce3fe2285
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -377,7 +377,9 @@ wl_pointer_axis_discrete(void *data, struct wl_pointer *wl_pointer,
? MOUSE_BTN_WHEEL_DOWN
: MOUSE_BTN_WHEEL_UP;
for (int32_t i = 0; i < discrete; i++) {
int count = abs(discrete);
for (int32_t i = 0; i < count; i++) {
backend->bar_on_mouse(
backend->bar, ON_MOUSE_CLICK, btn,
seat->pointer.x, seat->pointer.y);