feat(ui): quit on last macOS window close when opted in - #10988
proggeramlug wants to merge 2 commits into
Conversation
|
Warning Review limit reachedNext included review available in 2 minutes. View limit detailsLimit details: You’ve used all 8 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (13)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed on main in merge train 258 (#11078, v0.5.1641), main Carried at head This train was bisect-verified: after an earlier 35-PR assembly hit five gap regressions, the lowering-touching PRs were split into probes, and this set (#11070) came back with all six gap shards clean while the other half reproduced all five. Trains rebase-merge, so commits get new SHAs and GitHub cannot mark this merged. Closed as landed. |
Summary
Add
quitOnLastWindowClose?: booleantoApp({...}). The native compiler forwards the option before the app body is attached. On macOS, the application delegate answersapplicationShouldTerminateAfterLastWindowClosed:from this opt-in flag; its default remains false, so a closed app can still be reopened from the Dock. GTK4 and Windows already end their application loops on window close, and the non-desktop backends accept the option as a no-op.This gives macOS apps a way to terminate when the user closes the last window without a window handle or close callback.
applicationWillTerminate:continues to run through AppKit's normal termination path.Verification
cargo check -p perry-ui-macos --libpassed on macOS.cargo test -p perry-codegen --test app_window_config_options -- --test-threads=1passed: 5 tests, including presence and ordering of the new setter and omission when the option is absent.cargo fmt --all -- --check,scripts/check_file_size.sh, andgit diff --checkpassed.A manual window-close run was not performed.
Closes #10841.