0f5881788c
App windows are ordered by recency, so a focus change (correctly) triggers the ::window-changed signal. If we rebuild the section immediately in response, the activating item will be destroyed before the menu's ::activate handler, with the result that the menu remains open. Defer the section update in that case to allow the menu to process the ::activate signal first. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1948>