Skip to content

Commit

Permalink
Fix pointer enter event without further motion
Browse files Browse the repository at this point in the history
If the pointer suddenly enters a window but moves no further, we may only get
a POINTER_EVENT_ENTER but no further POINTER_EVENT_MOTION events, so we also
need to handle this event to properly update the selected item.

The issue can be reproduced by moving the mouse programatically, e.g. on Sway:
    swaymsg seat - cursor set 200 200
  • Loading branch information
joanbm authored and Cloudef committed Jul 5, 2022
1 parent 04b0d83 commit ef1055e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ bm_menu_run_with_pointer(struct bm_menu *menu, struct bm_pointer pointer)
}
}

if (pointer.event_mask & POINTER_EVENT_MOTION) {
if (pointer.event_mask & (POINTER_EVENT_ENTER | POINTER_EVENT_MOTION)) {
menu_point_select(menu, pointer.pos_x, pointer.pos_y, displayed);
}

Expand Down

0 comments on commit ef1055e

Please sign in to comment.