mirror of
https://github.com/swaywm/sway.git
synced 2026-04-04 07:15:48 -04:00
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:
parent
da9c86c608
commit
bfcfabee2b
5 changed files with 26 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue