Clicking Dock icon fails to bring up Control pane while kiosk is running #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
When TV Dashboard is running with the kiosk active on an external TV display (e.g. over AirPlay), clicking the app's Dock icon fails to bring up, restore, or focus the "TV Dashboard — Control" window.
Context / Environment
KioskWindowon.screenSaverlevel).Steps to Reproduce
Expected Behavior
Clicking the Dock icon should bring the "TV Dashboard — Control" pane to the front on the Mac's built-in/primary display, deminiaturizing it if minimized and ordering it front/key (
makeKeyAndOrderFront).Actual Behavior
Nothing happens. The Dock icon bounces/activates, but the control pane is not displayed or brought forward. Because
KioskWindowis pinned to the TV and does not accept key/main focus, the operator has no easy way to reopen the control pane without relaunching or finding another workaround.Root Cause Analysis
In
Sources/TVDashboard/AppDelegate.swift:NSApplicationDelegatedoes not implementapplicationShouldHandleReopen(_:hasVisibleWindows:).applicationShouldHandleReopen. BecauseKioskWindowis currently open and visible on the external TV screen,hasVisibleWindowsevaluates totrue.hasVisibleWindowsistrue. Even whenhasVisibleWindowsisfalse, default Cocoa behavior only unminimizes miniaturized windows; it does not re-open closed windows (even withisReleasedWhenClosed = false).KioskWindow.canBecomeKeyandcanBecomeMainare bothfalse, standard window focus traversal also does not bringadminWindowforward.Suggested Fix
Implement
applicationShouldHandleReopen(_:hasVisibleWindows:)inAppDelegate.swift:Optionally, also add a "Show Control Panel" menu item to
NSApp.mainMenu(and/or dock menuapplicationDockMenu(_:)) to ensure the control pane can always be reopened via keyboard shortcut or right-clicking the Dock icon.