fix: restore and bring forward control pane on Dock icon click (fixes #1) #2
Loading…
Reference in a new issue
No description provided.
Delete branch "fix_issue_one"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #1
Summary
When TV Dashboard is running with the kiosk active on an external TV display (or in a fullscreen local Space), clicking the Dock icon failed to bring up, restore, or focus the "TV Dashboard — Control" window if closed, minimized, or behind other windows.
Because
KioskWindowis pinned to the TV at.screenSaverlevel and cannot become key/main (canBecomeKey = false,canBecomeMain = false), Cocoa considers the application to have visible windows (hasVisibleWindows == true). In that state, default Cocoa behavior does not restore closed windows or deminiaturize windows.Changes
AppDelegate.swift:applicationShouldHandleReopen(_:hasVisibleWindows:)to callshowControlPanel().showControlPanel(_:)which deminiaturizes (if minimized), callsmakeKeyAndOrderFront, and activates the application. Also re-centers the window on the built-in/main screen if its screen was disconnected while closed.applicationDockMenu(_:)to provide "Show Control Panel" when right-clicking the Dock icon.⌘0toNSApp.mainMenu.SelfTest.swift:showControlPanelrestoring visibility from a closed state,applicationShouldHandleReopenrestoring visibility withhasVisibleWindows: trueandfalse, and dock menu item presence..wiki/wiki/references/task-routing.md:⌘0escape hatch contracts.Verification
make testpassed cleanly (SELFTEST OK,RUNTIME OK).