Close the panel when a tray item is selected

Selecting a tile opened the app's menu while SimpleTopBar's own panel
stayed on top of it, and could leave menus such as Spotlight stranded
behind it. Dismiss the panel first so the selected menu is unobstructed.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
This commit is contained in:
2026-09-27 10:26:09 +08:00
parent 29157c77fb
commit e465acba12
4 changed files with 19 additions and 1 deletions
+8
View File
@@ -132,6 +132,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
)
)
self.popover = popover
// Selecting a tray item must dismiss our panel, otherwise it stays on
// top of the menu that opens (and can strand menus behind it).
Task { @MainActor [weak self] in
MenuBarItemManager.shared.onWillPress = {
self?.popover?.performClose(nil)
}
}
}
@objc private func togglePopover() {