Skip to content

feat(ui): quit on last macOS window close when opted in - #10988

Closed
proggeramlug wants to merge 2 commits into
mainfrom
fix/10841-quit-last-window
Closed

proggeramlug wants to merge 2 commits into
mainfrom
fix/10841-quit-last-window

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Add quitOnLastWindowClose?: boolean to App({...}). The native compiler forwards the option before the app body is attached. On macOS, the application delegate answers applicationShouldTerminateAfterLastWindowClosed: 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 --lib passed on macOS.
  • cargo test -p perry-codegen --test app_window_config_options -- --test-threads=1 passed: 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, and git diff --check passed.

A manual window-close run was not performed.

Closes #10841.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1494876e-fc64-42a2-8313-c4557d38ab97

📥 Commits

Reviewing files that changed from the base of the PR and between c1569e2 and bc6abd4.

📒 Files selected for processing (13)
  • changelog.d/10988-quit-on-last-window-close.md
  • crates/perry-codegen/src/lower_call/native/native_ui_appshell_branch.rs
  • crates/perry-codegen/tests/app_window_config_options.rs
  • crates/perry-ui-android/src/ffi/tabbar_layout.rs
  • crates/perry-ui-gtk4/src/ffi/app_window.rs
  • crates/perry-ui-ios/src/ffi/dialogs_lifecycle.rs
  • crates/perry-ui-macos/src/app.rs
  • crates/perry-ui-macos/src/lib_ffi/core_widgets.rs
  • crates/perry-ui-tvos/src/ffi/app_keychain.rs
  • crates/perry-ui-visionos/src/ffi_system.rs
  • crates/perry-ui-watchos/src/lib.rs
  • crates/perry-ui-windows/src/ffi/app_window.rs
  • types/perry/ui/index.d.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main in merge train 258 (#11078, v0.5.1641), main e27f0a068a.

Carried at head bc6abd447a. CI on the train head was fully green — 22 jobs, zero failures, the first train since the public-baseline artifact was regenerated, so no known-red line to read past.

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.

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.

No way to quit a desktop app when its last window closes (applicationShouldTerminateAfterLastWindowClosed)

1 participant