fix: keep initial playback focus off the titlebar pin

Restore the playback window as first responder after initial setup and after file/YouTube dialogs return. Keep native control focus indicators and Tab navigation unchanged.

Verified hidden native window focus, both dialog cancellations, explicit control focus, Tab navigation, P shortcut, app build, and compact-window checks.
This commit is contained in:
2026-10-10 23:15:09 +02:00
parent 8fb08db6f3
commit 5bc0d81bbf
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -85,6 +85,7 @@ final class PlayerModel: ObservableObject {
func openPanel() {
guard canOpen else { return }
defer { window?.makeFirstResponder(nil) }
revealControls()
let panel = NSOpenPanel()
panel.canChooseFiles = true
@@ -97,6 +98,7 @@ final class PlayerModel: ObservableObject {
func openYouTubePanel() {
guard canOpen else { return }
defer { window?.makeFirstResponder(nil) }
revealControls()
let alert = NSAlert()
alert.messageText = "Open YouTube Video"
@@ -1030,6 +1032,7 @@ private struct WindowChrome: NSViewRepresentable {
guard let self, let window else { return }
self.model.attachWindow(window)
self.updateButtons()
window.makeFirstResponder(nil)
}
}