aboutsummaryrefslogtreecommitdiffstats
path: root/include/swaybar
diff options
context:
space:
mode:
authorLibravatar minus <minus@mnus.de>2018-07-19 21:15:01 +0200
committerLibravatar minus <minus@mnus.de>2018-07-19 21:15:01 +0200
commitbfcfabee2b7e6bd820929a3cb86c4981a6385ac7 (patch)
treee529edd478b8ebfbf19daa7072535d0e181592d2 /include/swaybar
parentMerge pull request #2310 from RyanDwyer/assign-output (diff)
downloadsway-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 'include/swaybar')
-rw-r--r--include/swaybar/bar.h7
-rw-r--r--include/swaybar/status_line.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h
index f1ff25b2..1cecea71 100644
--- a/include/swaybar/bar.h
+++ b/include/swaybar/bar.h
@@ -29,10 +29,15 @@ enum x11_button {
29 FORWARD, 29 FORWARD,
30}; 30};
31 31
32enum hotspot_event_handling {
33 HOTSPOT_IGNORE,
34 HOTSPOT_PROCESS,
35};
36
32struct swaybar_hotspot { 37struct swaybar_hotspot {
33 struct wl_list link; 38 struct wl_list link;
34 int x, y, width, height; 39 int x, y, width, height;
35 void (*callback)(struct swaybar_output *output, 40 enum hotspot_event_handling (*callback)(struct swaybar_output *output,
36 int x, int y, enum x11_button button, void *data); 41 int x, int y, enum x11_button button, void *data);
37 void (*destroy)(void *data); 42 void (*destroy)(void *data);
38 void *data; 43 void *data;
diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h
index 2eaf8140..de9b98d7 100644
--- a/include/swaybar/status_line.h
+++ b/include/swaybar/status_line.h
@@ -71,7 +71,7 @@ void status_error(struct status_line *status, const char *text);
71bool status_handle_readable(struct status_line *status); 71bool status_handle_readable(struct status_line *status);
72void status_line_free(struct status_line *status); 72void status_line_free(struct status_line *status);
73bool i3bar_handle_readable(struct status_line *status); 73bool i3bar_handle_readable(struct status_line *status);
74void i3bar_block_send_click(struct status_line *status, 74enum hotspot_event_handling i3bar_block_send_click(struct status_line *status,
75 struct i3bar_block *block, int x, int y, enum x11_button button); 75 struct i3bar_block *block, int x, int y, enum x11_button button);
76void i3bar_block_free(struct i3bar_block *block); 76void i3bar_block_free(struct i3bar_block *block);
77enum x11_button wl_button_to_x11_button(uint32_t button); 77enum x11_button wl_button_to_x11_button(uint32_t button);