From ef1055eccec850daac8b568726317b4f8f0d4c2a Mon Sep 17 00:00:00 2001 From: Joan Bruguera Date: Sat, 2 Jul 2022 20:58:21 +0200 Subject: [PATCH] Fix pointer enter event without further motion 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 --- lib/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/menu.c b/lib/menu.c index 7479f8d1..381fbfce 100644 --- a/lib/menu.c +++ b/lib/menu.c @@ -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); }