Repository navigation
wm_api: a hosted app may answer a close; the terminal does - #68
Merged
Merged
Conversation
A WM that followed CloseRequested with Kill ended a process terminal's running jobs even though the terminal refused the close and asked (OctoSense-org/OctoSense#179). A WM cannot wait for an answer it cannot tell from silence, so two additive requests say it: - WmRequest::AsksBeforeClose: this app answers CloseRequested itself. The terminal sends it in reply to WmEvent::Hosted. - WmRequest::CloseRefused: not now, the app is asking the person. The terminal sends it on every refusal, so a repeated close is answered again and a WM can tell a live, asking app from a hung one. The hosted (Studio stdin) runtime ignores cx.quit(), so a hosted terminal that agrees to close (nothing running, or the person said yes) now asks the WM to close it with WmRequest::Close; standalone it quits as before. Ctrl+Shift+W on the last tab uses the same path. apps/wm keeps closing with CloseRequested + Kill and ignores both words. The wire form ({"wm":{"CloseRefused":[]}}) is pinned by a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
For OctoSense-org/OctoSense#179 (the shell side is OctoSense-org/OctoSense#187).
A WM that follows
CloseRequestedwithKillends a process terminal's running jobs even though the terminal (since #65) refuses the close and asks. A WM cannot wait for an answer it cannot tell from silence, so this adds two additive requests:WmRequest::AsksBeforeClose: this app answersCloseRequesteditself. The terminal sends it in reply toWmEvent::Hosted.WmRequest::CloseRefused: not now, the app is asking the person. The terminal sends it on every refusal. A repeated close gets a fresh answer, so a WM can tell a live, asking app from a hung one.Found while testing: the hosted (Studio stdin) runtime on macOS drops
CxOsOp::Quit, socx.quit()does nothing in a hosted app. Until now the WM'sKillhid this. A hosted terminal that agrees to close (nothing running, or the person said yes) now sendsWmRequest::Close. Standalone it callscx.quit()as before. Ctrl+Shift+W on the last tab takes the same path.apps/wmstill closes withCloseRequested+Killand ignores both new words. A test pins the wire form ({"wm":{"CloseRefused":[]}}), because OctoSense matches on that exact text so it works with older pins.Tests
cargo test -p makepad-wm-api: 5 passed, including the newclose_answers_round_trip.cargo check -p makepad-terminal -p makepad-wm: clean.rustfmt --checkpasses on the touched files.cargo test -p makepad-terminal: 388 passed, 4 failed. The 4 aresession::tests::*PTY tests. They fail the same way onmain(bcb0583) on this machine, so this change did not cause them..sources/makepad: see the OctoSense PR.🤖 Generated with Claude Code