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.
This commit is contained in:
minus 2018-07-19 21:15:01 +02:00
parent da9c86c608
commit bfcfabee2b
5 changed files with 26 additions and 12 deletions

View file

@ -192,11 +192,11 @@ bool i3bar_handle_readable(struct status_line *status) {
return redraw;
}
void i3bar_block_send_click(struct status_line *status,
enum hotspot_event_handling i3bar_block_send_click(struct status_line *status,
struct i3bar_block *block, int x, int y, enum x11_button button) {
wlr_log(WLR_DEBUG, "block %s clicked", block->name ? block->name : "(nil)");
if (!block->name || !status->i3bar_state.click_events) {
return;
return HOTSPOT_PROCESS;
}
struct json_object *event_json = json_object_new_object();
@ -215,6 +215,7 @@ void i3bar_block_send_click(struct status_line *status,
status_error(status, "[failed to write click event]");
}
json_object_put(event_json);
return HOTSPOT_IGNORE;
}
enum x11_button wl_button_to_x11_button(uint32_t button) {