diff --git a/WINGs/wpopupbutton.c b/WINGs/wpopupbutton.c index 01e210f..012e076 100644 --- a/WINGs/wpopupbutton.c +++ b/WINGs/wpopupbutton.c @@ -622,10 +622,15 @@ static void handleActionEvents(WMEvent * event, void *data) break; case WME_LEAVE: - bPtr->flags.insideMenu = 0; - if (bPtr->menuView->flags.mapped) - paintMenuEntry(bPtr, bPtr->highlightedItem, False); - bPtr->highlightedItem = -1; + /* Only clear menu state on leave from the menu view itself. + * Leave from the main button view is just the pointer moving + * to the popup — don't cancel the active drag-selection. */ + if (event->window == bPtr->menuView->window) { + bPtr->flags.insideMenu = 0; + if (bPtr->menuView->flags.mapped) + paintMenuEntry(bPtr, bPtr->highlightedItem, False); + bPtr->highlightedItem = -1; + } break; case WME_ENTER: