aboutsummaryrefslogtreecommitdiff
path: root/swaybar/bar.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2018-07-19 21:15:01 +0200
committerFurkan Sahin <furkan-dev@proton.me>2018-07-19 21:15:01 +0200
commit81e6d34e3d38122a73542ba9d740f6ea58a8792f (patch)
treee529edd478b8ebfbf19daa7072535d0e181592d2 /swaybar/bar.c
parent508512bff20fbbd59b1a412bbed6b651d61a0162 (diff)
swaybar: Fix scroll handling on workspace buttons
As well as ignoring scroll events on status elements when click_events is enabled. Previously, using the scroll wheel on a workspace button would switch to that workspace instead of scrolling through them. Clicks and scrolling on status elements would always be processed by swaybar, too. So in case you were using scrolling as volume control on a status item, swaybar would additionally scroll through your workspaces.
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 94bc48bc..62a7727e 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -146,8 +146,10 @@ static void wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
&& y >= hotspot->y
&& x < hotspot->x + hotspot->width
&& y < hotspot->y + hotspot->height) {
- hotspot->callback(output, pointer->x, pointer->y,
- wl_button_to_x11_button(button), hotspot->data);
+ if (HOTSPOT_IGNORE == hotspot->callback(output, pointer->x, pointer->y,
+ wl_button_to_x11_button(button), hotspot->data)) {
+ return;
+ }
}
}
}
@@ -169,9 +171,11 @@ static void wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
&& y >= hotspot->y
&& x < hotspot->x + hotspot->width
&& y < hotspot->y + hotspot->height) {
- hotspot->callback(output, pointer->x, pointer->y,
- wl_axis_to_x11_button(axis, value), hotspot->data);
- return;
+ if (HOTSPOT_IGNORE == hotspot->callback(
+ output, pointer->x, pointer->y,
+ wl_axis_to_x11_button(axis, value), hotspot->data)) {
+ return;
+ }
}
}