diff options
author | minus <minus@mnus.de> | 2018-07-19 21:15:01 +0200 |
---|---|---|
committer | minus <minus@mnus.de> | 2018-07-19 21:15:01 +0200 |
commit | bfcfabee2b7e6bd820929a3cb86c4981a6385ac7 (patch) | |
tree | e529edd478b8ebfbf19daa7072535d0e181592d2 /swaybar/bar.c | |
parent | Merge pull request #2310 from RyanDwyer/assign-output (diff) | |
download | sway-bfcfabee2b7e6bd820929a3cb86c4981a6385ac7.tar.gz sway-bfcfabee2b7e6bd820929a3cb86c4981a6385ac7.tar.zst sway-bfcfabee2b7e6bd820929a3cb86c4981a6385ac7.zip |
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.c | 14 |
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, | |||
146 | && y >= hotspot->y | 146 | && y >= hotspot->y |
147 | && x < hotspot->x + hotspot->width | 147 | && x < hotspot->x + hotspot->width |
148 | && y < hotspot->y + hotspot->height) { | 148 | && y < hotspot->y + hotspot->height) { |
149 | hotspot->callback(output, pointer->x, pointer->y, | 149 | if (HOTSPOT_IGNORE == hotspot->callback(output, pointer->x, pointer->y, |
150 | wl_button_to_x11_button(button), hotspot->data); | 150 | wl_button_to_x11_button(button), hotspot->data)) { |
151 | return; | ||
152 | } | ||
151 | } | 153 | } |
152 | } | 154 | } |
153 | } | 155 | } |
@@ -169,9 +171,11 @@ static void wl_pointer_axis(void *data, struct wl_pointer *wl_pointer, | |||
169 | && y >= hotspot->y | 171 | && y >= hotspot->y |
170 | && x < hotspot->x + hotspot->width | 172 | && x < hotspot->x + hotspot->width |
171 | && y < hotspot->y + hotspot->height) { | 173 | && y < hotspot->y + hotspot->height) { |
172 | hotspot->callback(output, pointer->x, pointer->y, | 174 | if (HOTSPOT_IGNORE == hotspot->callback( |
173 | wl_axis_to_x11_button(axis, value), hotspot->data); | 175 | output, pointer->x, pointer->y, |
174 | return; | 176 | wl_axis_to_x11_button(axis, value), hotspot->data)) { |
177 | return; | ||
178 | } | ||
175 | } | 179 | } |
176 | } | 180 | } |
177 | 181 | ||