m29 drags follow-up: a cancelled size's drag grid reaches the program; drag test on a manual clock
Merged
LA
14h ago+107+107+012345678901234567890123456789-18-18-01234567890123456789
Follow-up to #36631 (merged as 9511b2df1c8): the two non-blocking notes of its review, each fixed.
Why
- A drag grid whose size the presenter cancels never reached the program. During a drag, a terminal's grid for a size asked of Ghostty waits until the frame of that size lands. When the frame presenter cancelled that size instead (the terminal hidden, or moved out of its window, before the frame landed), the reporter kept only a flag, and the view's geometry already counted that grid as reported. The program kept an older grid until the next resize.
- The drag grid test slept in real time.
DividerDragTerminalResizeCountTestsslept 12 ms per drag frame so the 25 ms windows could close; a loaded runner stretches those sleeps.
Fix
TerminalGridReporterkeeps the waiting grid itself (awaitingShown). Both cancel sites (place()for a hidden or windowless view,releaseFrameOwnership()on a window change) callshownCancelled(live:): the grid goes, coalesced while the drag is followed, else now. No one sees that size either way (the view is hidden or out of its window).TerminalGridReporter(view:clock:)takes the coalescer's clock (ContinuousClockby default, as before). The count test gives each terminal's reporter oneManualClockand advances it 12 ms per drag frame.TerminalSurfaceViewkeeps its base line count (god-type rule): two doc lines are shorter.
Changelog
- none
Tests
| Run | Ref | Step | Result |
|---|---|---|---|
| red: cancelled size (display) | 3210fea3e9e (test only) | 7fe83b635460da9d9ff15319 | queued |
| green: display | d7c6c5d149d | fd8982d21b79f5612978e5bb | queued |
| green: 8 suites (manual-clock count test included) | d7c6c5d149d | 6c3a5804dfc95e630975109c | queued |
| app build | d7c6c5d149d | 0122ae52a843465697b15f9b | queued |
Note 2 changes no product behavior (the default clock is the one used before), so it has no behavioral red; the count test's own red and green stand from #36631 (10980491, 8fc86066).
Observed / Not run
- Observed: prepush gate, check-no-godfiles.
- Not run yet: the steps above; launch smoke.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes two non-blocking review notes from #36631: a drag grid whose size the presenter cancels now reaches the program, and drag resize count tests run on a manual clock instead of sleeping in real time.
Bug Fixes
TerminalGridReporterkeeps the waiting grid itself (awaitingShown) rather than a flag. Both cancel sites — a hidden view inplace()and a window change inreleaseFrameOwnership()— callshownCancelled(live:), so the grid goes coalesced while the drag is followed, else now.TerminalGridReporter(view:clock:)takes the coalescer's clock (ContinuousClockby default, unchanged behavior).DividerDragTerminalResizeCountTestsnow injects aManualClock, advanced 12 ms per drag frame, so the coalescer's 25 ms windows close without real sleep.- Adds
TerminalDragCancelledSizeGridTests, which hides a terminal's host while its drag size is in flight and asserts the program receives the grid it fits.