Skip to content

Fix native macOS termination handling - #654

Merged
trypsynth merged 1 commit into
trypsynth:masterfrom
johanntan:fix/macos-native-quit
Aug 18, 2026
Merged

Fix native macOS termination handling#654
trypsynth merged 1 commit into
trypsynth:masterfrom
johanntan:fix/macos-native-quit

Conversation

@johanntan

Copy link
Copy Markdown
Contributor

Summary

  • update the locked wxDragon revision to one containing its macOS termination lifecycle hooks
  • approve native macOS termination requests through AppEvents::on_should_terminate
  • preserve the existing behavior where an ordinary red-button window close hides Paperback

Root cause

wxWidgets checks whether a macOS application may terminate by sending a vetoable close event to its top window. Paperback treated every vetoable macOS close as an ordinary window close, vetoed it, and hid the frame. This also cancelled shutdown/restart and Quit requests sent from the Dock or Application Switcher.

Current wxDragon main exposes OSXOnShouldTerminate through on_should_terminate, allowing Paperback to distinguish application termination without relying on Cocoa internals.

Validation

  • cargo +nightly fmt --check
  • cargo build -p paperback
  • cargo check -p paperback --locked
  • cargo test -p paperback (40 passed)
  • native macOS Apple Event termination smoke test; callback ran and the process exited with status 0

@johanntan
johanntan marked this pull request as ready for review August 18, 2026 14:35
@trypsynth
trypsynth merged commit 906d977 into trypsynth:master Aug 18, 2026
8 checks passed
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.

2 participants