Skip to content

Move windows out from behind the dashboard - #45

Open
masonjmiller wants to merge 3 commits into
kemalandic:mainfrom
masonjmiller:window-rescue
Open

masonjmiller wants to merge 3 commits into
kemalandic:mainfrom
masonjmiller:window-rescue

Conversation

@masonjmiller

Copy link
Copy Markdown

In kiosk mode, a window that opens on the dashboard's display now moves to the display you're using, instead of opening behind the dashboard where it can't be seen or reached.

Why

The kiosk dashboard covers its display above every app window. macOS keeps putting windows there anyway:

  • New apps open on the display last clicked, which is the dashboard's after any click on it.
  • Apps reopen windows where they were last closed.
  • On wake, windows that were on the dashboard's display before it slept go back to it.

On a XENEON EDGE this happens several times a day. The window is open and active, but invisible, and the only way to get it back is to quit the dashboard or drag it blind.

How

  • WindowRescueService watches for an app coming forward or launching, for any window an app creates (an AXObserver per app), and for display changes. Each time, it checks that app's windows, or every app's on a display change.
  • Which windows move: a standard, dialog or floating window whose centre is behind the dashboard. Minimised and full-screen windows are left alone, and so is a window mostly on another display.
  • Where they go: the centre of the display under the pointer. If the pointer is on the dashboard, they go to the menu bar's display, or else to any other display. A window bigger than its new display is shrunk to fit.
  • Only while the dashboard covers its display: in window mode, hidden, or parked, nothing moves.
  • It needs Accessibility, as any app that moves another app's windows does. Without it the service does nothing, and General settings shows a line saying so with an Allow… button, which brings up macOS's own prompt. Settings checks for the permission every 2 seconds while open, and once it's allowed, it moves any windows already behind the dashboard.
  • A setting, Move Windows Out from Behind the Dashboard, is in General. It's on by default, since it does nothing until someone allows Accessibility. It's saved as moveWindowsFromBehindDashboard, and existing layout files read as on.
  • Not in the test host. Tests run inside a copy of the app with the same bundle identifier. macOS ties an Accessibility attempt to the build that made it, so a test run could take the permission away from the installed app.
  • Logging: moves, and a missing permission at start, go to a new Windows log category at notice level.
  • The Guide's Dashboard section has a line on it.

Testing

  • xcodebuild test passes in full: 393 Swift Testing tests in 38 suites. Six are new, for where windows go:

    • centred on the target display;
    • shrunk to fit;
    • left alone when mostly on another display;
    • sent to the display under the pointer;
    • sent to the menu bar's display when the pointer is on the dashboard;
    • nowhere to go when the dashboard's display is the only one.

    swift-format is clean, and the build has no warnings.

  • On a XENEON EDGE above two Studio Displays (macOS 27.2), in daily use:

    • windows of apps that kept reopening on the Edge came back on the display in use;
    • a test window opened on the Edge, behind the dashboard, moved to the display under the pointer within a second;
    • with Accessibility not allowed, nothing moved, and the log said why.

Overlap

#32 adds two toggles next to this one in GlobalSettings and General settings, and #36 adds lines next to this PR's in AppLog and AppModel. Both conflict only where lines sit side by side, and the fix is to keep both; I run this merged with #32. #30 merges cleanly.

🤖 Generated with Claude Code

masonjmiller and others added 3 commits November 1, 2026 23:34
In kiosk mode the dashboard covers its display above every app window, so a
window that lands there can't be seen or reached. macOS puts windows there
more often than it seems: a new app opens on the display last clicked, an
app reopens its windows where they were last closed, and windows go back to
the dashboard's display when it wakes.

WindowRescueService watches for apps coming forward, apps opening windows
and the displays changing, and moves any standard window or dialog whose
centre is on the dashboard to the display under the pointer (or the menu
bar's, when the pointer is on the dashboard), centred and shrunk to fit.
Minimised and full-screen windows are left alone.

It needs the Accessibility permission. General has the switch, on by
default, and an Allow button while the permission is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test host shares the bundle identifier, and macOS recorded its
Accessibility attempt against the test build, taking the permission from
the real app. Without the permission, don't make the calls at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant