ui: Dismiss context menus when window loses focus (#46866)

Context menus close when the window becomes inactive (e.g., clicking to
another window or app). Previously, menus would remain visible until the
window regained focus.

This aligns Zed's context menu behavior with native macOS apps, where
NSMenu automatically dismisses when the window loses focus. Users expect
menus to close when switching windows or apps.

Uses `observe_window_activation` to detect when the window becomes
inactive and calls `cancel` to dismiss the menu.

Release Notes:

- Fixed context menus dismiss/cancel when the window loses focus

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
d139c5e6d2Jake Go committed on 1/15/2026, 1:55:20 PM· committed by GitHubparent39569ef
1 file changedLine totals unavailable