Skip to content

Commit

Permalink
fixup! handle also pointer axis when using tray
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Weilbach authored and codicodi committed Oct 8, 2021
1 parent b2bf54c commit 89e2544
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/swaybar/tray/dbusmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ bool dbusmenu_pointer_leave(void *data, struct wl_pointer *wl_pointer,
bool dbusmenu_pointer_frame(struct swaybar_seat *data,
struct wl_pointer *wl_pointer);

bool dbusmenu_pointer_axis(struct swaybar_seat *data,
struct wl_pointer *wl_pointer);

#endif
6 changes: 6 additions & 0 deletions swaybar/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ static void wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
return;
}

#if HAVE_TRAY
if (dbusmenu_pointer_axis(data, wl_pointer)) {
return;
}
#endif

// If there's a while since the last scroll event,
// set 'value' to zero as if to reset the "virtual scroll wheel"
if (seat->axis[axis].discrete_steps == 0 &&
Expand Down
9 changes: 9 additions & 0 deletions swaybar/tray/dbusmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,15 @@ bool dbusmenu_pointer_frame(struct swaybar_seat *data,
return true;
}

bool dbusmenu_pointer_axis(struct swaybar_seat *data,
struct wl_pointer *wl_pointer) {
struct swaybar_tray *tray = data->bar->tray;
if (!(tray && tray->menu && tray->menu_pointer_focus)) {
return false;
}
return true;
}

bool dbusmenu_pointer_enter(void *data, struct wl_pointer *wl_pointer,
uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x,
wl_fixed_t surface_y) {
Expand Down

0 comments on commit 89e2544

Please sign in to comment.