fix: alttab would crash after menubar icon was actioned with voiceover

closes #3211
This commit is contained in:
lwouis
2024-03-03 12:45:07 +01:00
parent b8833b74eb
commit f7fdf3f987
+4 -3
View File
@@ -49,10 +49,11 @@ class Menubar {
}
@objc func statusItemOnClick() {
if NSApp.currentEvent!.type == .leftMouseDown {
statusItem.popUpMenu(App.app.menubar.menu)
} else {
// NSApp.currentEvent == nil if the icon is "clicked" through VoiceOver
if let type = NSApp.currentEvent?.type, type != .leftMouseDown {
App.app.showUi()
} else {
statusItem.popUpMenu(App.app.menubar.menu)
}
}