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/i3bar.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/i3bar.c')
-rw-r--r-- | swaybar/i3bar.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c index 78b183ad..ae37eeb9 100644 --- a/swaybar/i3bar.c +++ b/swaybar/i3bar.c | |||
@@ -192,11 +192,11 @@ bool i3bar_handle_readable(struct status_line *status) { | |||
192 | return redraw; | 192 | return redraw; |
193 | } | 193 | } |
194 | 194 | ||
195 | void i3bar_block_send_click(struct status_line *status, | 195 | enum hotspot_event_handling i3bar_block_send_click(struct status_line *status, |
196 | struct i3bar_block *block, int x, int y, enum x11_button button) { | 196 | struct i3bar_block *block, int x, int y, enum x11_button button) { |
197 | wlr_log(WLR_DEBUG, "block %s clicked", block->name ? block->name : "(nil)"); | 197 | wlr_log(WLR_DEBUG, "block %s clicked", block->name ? block->name : "(nil)"); |
198 | if (!block->name || !status->i3bar_state.click_events) { | 198 | if (!block->name || !status->i3bar_state.click_events) { |
199 | return; | 199 | return HOTSPOT_PROCESS; |
200 | } | 200 | } |
201 | 201 | ||
202 | struct json_object *event_json = json_object_new_object(); | 202 | struct json_object *event_json = json_object_new_object(); |
@@ -215,6 +215,7 @@ void i3bar_block_send_click(struct status_line *status, | |||
215 | status_error(status, "[failed to write click event]"); | 215 | status_error(status, "[failed to write click event]"); |
216 | } | 216 | } |
217 | json_object_put(event_json); | 217 | json_object_put(event_json); |
218 | return HOTSPOT_IGNORE; | ||
218 | } | 219 | } |
219 | 220 | ||
220 | enum x11_button wl_button_to_x11_button(uint32_t button) { | 221 | enum x11_button wl_button_to_x11_button(uint32_t button) { |