Skip to content

feat: full screen, zoom and the Dock — setWindowFullScreen, setWindowZoomed and setWindowMiniaturized, window-fullscreen and window-miniaturize events, and fullscreen/zoomed/miniaturized in the published window state - #124

Merged
sidorares merged 1 commit into
mainfrom
feat/fullscreen
Oct 20, 2026

Conversation

@sidorares

Copy link
Copy Markdown
Contributor

The title bar's green button took a window into a full-screen Space and the bridge said nothing. The delegate handled no full-screen notification, so a renderer saw only the resize, and it had no verb to ask for full screen, the zoom or the Dock either — the part of #15 that was scoped out.

What it adds

  • setWindowFullScreen(win, on), setWindowZoomed(win, on), setWindowMiniaturized(win, on) — commands, so they work from a worker unchanged.
  • window-fullscreen { fullscreen, phase: 'begin' | 'end' }. The begin is AppKit's will-enter or will-exit, before the animation, so an app can take its chrome away while the window grows rather than after it. A transition AppKit could not finish ends with the state it started from.
  • window-miniaturize { miniaturized }.
  • fullscreen, zoomed and miniaturized in the published window state, getWindowFrame and windowState. fullscreen says the target from a transition's begin.

Decisions

  • A setWindowFullScreen during a transition is held and applied when it ends: AppKit drops a toggle mid-animation, so without it an app that changed its mind was left in the wrong state.
  • zoomed is false for the whole transition. On the way out the window is still the screen's size and isZoomed said yes for a few milliseconds; found running react-x11 over this branch, and the test now reads the state at every event of an exit.
  • A transition is also a live resize, and comes inside window-live-resize's two ends. Nothing here changes that.

Tests

  • test/window-states.js, pump mode: a real round trip through a Space, the published state at the begin, an ask made during the exit and applied at its end, an ask the transition already satisfies starting nothing, the zoom, the Dock. Disabling the held ask fails it.
  • test/threaded-window-states.js, the same from a worker. Its own file: a trip through a Space unsettles the pop-up menus threaded-verbs.js opens after it.
  • npm test passes on macOS 15, M-series.

react-x11 adopts it in the PR that follows, which maps these onto useWindowState, onStatesChange and <window fullscreen>.

…Zoomed and setWindowMiniaturized, window-fullscreen and window-miniaturize events, and fullscreen/zoomed/miniaturized in the published window state

The title bar's green button took a window into a full-screen Space and
nothing said so: the delegate handled no full-screen notification, so a
renderer saw only the resize, and could not ask for full screen either.

window-fullscreen { fullscreen, phase: 'begin' | 'end' } brackets each
transition. The begin is AppKit's will-enter or will-exit, before the
animation, so an app can take its chrome away while the window grows, and
the published state says the target from then on. A transition AppKit
could not finish ends with the state it started from, and a
setWindowFullScreen during one, which AppKit would drop, is applied when it
ends. `zoomed` is false through the whole transition, since a window on
its way out of full screen is still the screen's size.

test/window-states.js drives a real round trip in pump mode, and
test/threaded-window-states.js from a worker; it is a file of its own
because a trip through a Space unsettles the pop-up menus threaded-verbs.js
opens after.
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