fix: restore window and keyboard interactions with queue

This commit is contained in:
2026-10-18 01:51:51 +02:00
parent afb0c30e09
commit 07243f0ed7
6 changed files with 279 additions and 39 deletions
+7 -4
View File
@@ -79,11 +79,14 @@ extension PlayerModel {
}
private func handleKeyEvent(_ event: NSEvent, in window: NSWindow, chord: KeyChord) -> Bool {
guard event.window === window, NSApp.modalWindow == nil, window.attachedSheet == nil,
!(window.firstResponder is NSTextView), !(window.firstResponder is NSTextField) else { return false }
// Preserve focus traversal, control activation/navigation and VoiceOver's own chords.
guard event.window === window, NSApp.modalWindow == nil, window.attachedSheet == nil else { return false }
let responder = window.firstResponder
if let text = responder as? NSTextView, text.isEditable || text.isSelectable { return false }
if let text = responder as? NSTextField, text.isEditable || text.isSelectable { return false }
// Lists and inert labels are playback surfaces, not text entry or activation controls.
// Keep deliberate button/slider focus, traversal and VoiceOver's own chords native.
if chord.key == "tab" && chord.modifiers.subtracting(.shift).isEmpty { return false }
if window.firstResponder is NSControl,
if responder is NSControl, !(responder is NSTableView), !(responder is NSTextField),
chord.modifiers.subtracting(.shift).isEmpty,
Self.nativeNavigationKeys.contains(chord.key) {
return false