Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Allkdic/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

private func setupEventMonitor() {
self.eventMonitor = NSEvent.addGlobalMonitorForEvents(matching: [.leftMouseUp, .leftMouseDown]) { [weak self] _ in
// Watch only `.leftMouseDown`: on macOS 27 the `.leftMouseUp` of the very click that opens the
// popover reaches this global monitor, which closed the popover right after it appeared (#96).
// A press outside is enough to dismiss, so the release never needed to be observed.
self.eventMonitor = NSEvent.addGlobalMonitorForEvents(matching: .leftMouseDown) { [weak self] _ in
self?.closePopover()
}
NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event in
Expand Down
Loading