Repository navigation
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
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,zoomedandminiaturizedin the published window state,getWindowFrameandwindowState.fullscreensays the target from a transition's begin.Decisions
setWindowFullScreenduring 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.zoomedis false for the whole transition. On the way out the window is still the screen's size andisZoomedsaid 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.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 menusthreaded-verbs.jsopens after it.npm testpasses on macOS 15, M-series.react-x11 adopts it in the PR that follows, which maps these onto
useWindowState,onStatesChangeand<window fullscreen>.