Repository navigation
fix: re-read a restored window until the Dock animation ends - #22
Merged
Merged
Conversation
Restoring a minimized TextEdit window reported outcome unknown with "The confirmed window mutation could not prove its requested postcondition." although the window was restored, on screen and active right after (githubnext/ace#427, D9b). The service confirms an exact minimized restore by repinning WindowServer bounds, which minimizing leaves unchanged, so it returns at once; the bridge's single readback then falls back to an Accessibility scan that still reports the window minimized while the Dock's unminimize animation runs. A new last patch, peekaboo-restore.patch, reads the window again only when a restoreWindow readback fails its requested-state postcondition, at most 8 times 100 ms apart. Each read posts no input and repeats the full identity, process-generation and bounds validation; identity and lookup failures and a window that stays minimized remain indeterminate. Why: native/patches/peekaboo-restore.patch | Only the read-only restore postcondition mismatch is re-read; identity failures and a window that stays minimized stay indeterminate.
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.
In the Ace desktop tools study (githubnext/ace#427, D9b), restoring a minimized TextEdit window reported outcome
unknownwith "The confirmed window mutation could not prove its requested postcondition." An observation right after showed the window restored, on screen and active.Cause. For an exact minimized restore, the service sets
AXMinimizedfalse once, then "confirms" by repinning the WindowServer bounds. Minimizing leaves those bounds unchanged, so it returns at once. The bridge's single readback (windowMutationResponse) then sees the WindowServer row still off screen, falls back to an Accessibility scan, and that scan still reports the window minimized while the Dock's unminimize animation (about 0.3–0.5 s) runs.validatePostMutationWindowthrowsreceiptMismatch("post-mutation window postcondition"), which the bridge maps to indeterminate.Fix. A new last patch,
peekaboo-restore.patch, moves the readback and validation into a helper and reads again only when arestoreWindowreadback fails that requested-state postcondition, at most 8 times 100 ms apart (same shape as #19). Each read posts no input and repeats the full identity, process-generation and bounds validation. Identity, lookup and continuity failures fail on the first read, and a window that stays minimized for the whole bound still endsunknown. It is appended tosrc/build.ts(anddist/build.js) so the existing stack stays a valid prefix; the README documents it.Verification
node dist/build.js --out … --scratch …builds with the full stack.PeekabooCoreswift test --filter "PeekabooBridgeHandlerMutationSemanticsTests|PeekabooTests.PeekabooBridgeTests"passes (97 swift-testing), including the new test "confirmed restore reads a still minimized window again until its postcondition holds" (minimized, minimized, restored completes after 3 reads; persistently minimized stays indeterminate after 9).npm run check(dist matches tsc).