summaryrefslogtreecommitdiff
path: root/swaybar/bar.c
diff options
context:
space:
mode:
authorminus <[email protected]>2018-07-19 21:15:01 +0200
committerminus <[email protected]>2018-07-19 21:15:01 +0200
commitbfcfabee2b7e6bd820929a3cb86c4981a6385ac7 (patch)
treee529edd478b8ebfbf19daa7072535d0e181592d2 /swaybar/bar.c
parentda9c86c608b33d78e25ced5858be579f502efd63 (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;
+ }
}
}