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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user