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)