From 6b5b015cd8e015fb62f44f9934c47f0c25de6034 Mon Sep 17 00:00:00 2001 From: lkn Date: Sun, 7 Jun 2026 16:42:25 +0200 Subject: [PATCH] popDownMenu: reset insideMenu and highlightedItem to prevent stale state on reopen --- WINGs/wpopupbutton.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/WINGs/wpopupbutton.c b/WINGs/wpopupbutton.c index 8e982eb..f3613c3 100644 --- a/WINGs/wpopupbutton.c +++ b/WINGs/wpopupbutton.c @@ -516,6 +516,13 @@ static void popUpMenu(PopUpButton * bPtr) static void popDownMenu(PopUpButton * bPtr) { W_UnmapView(bPtr->menuView); + /* Clear interactive state so the next open starts from a clean + * slate. insideMenu and highlightedItem must be reset here; + * relying on WME_LEAVE from the NULL/1x1 unmap is unreliable. + * Stale highlightedItem causes the next BUTTON_RELEASE to + * immediately close the popup. */ + bPtr->flags.insideMenu = 0; + bPtr->highlightedItem = -1; } static void autoScroll(void *data)