diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-18 17:05:06 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-18 17:31:08 -0300 |
| commit | 28921f1f793938b2d40a1a8fee43d3b1b0f7c4d2 (patch) | |
| tree | 1b0c7ed5e67e8844bc89e2d17a252ae4676edcc4 /src/gui/gui.zig | |
| parent | f7fc58ee8ae9a88b09ee1c235b9986df8b1ef844 (diff) | |
| download | pardes-28921f1f793938b2d40a1a8fee43d3b1b0f7c4d2.tar.gz pardes-28921f1f793938b2d40a1a8fee43d3b1b0f7c4d2.zip | |
gui, panes: a window client posts its size once while its view is not that size yet (Client.posted, let go when the view is the window's or at a rejoin), not on every pass while the session has not taken it (the soak's windows posted 36 resizes at rtt 30 and 128 at 207 with three clients in round 4, 19 and 13 now; the soak's window clients do the same); and a screen-state client's speculation of a terminal's resize does what its replay does (the pane's selections, never the grid, which the session's next delta sizes), so a resize no longer stops and waits a round trip (the soak's stopped inputs 135 -> 59 at rtt 30, 120 -> 61 at 80); replicas five clients diverged 0, unequal 0, three clients diverged 0; tui core-test 823/964, shell-test 999/1002, behaviour --replay 20 seeds 0 failures, pane-test 180/181
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/gui/gui.zig')
| -rw-r--r-- | src/gui/gui.zig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index a8816494..4f6a58c2 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -1216,6 +1216,10 @@ const Client = struct { inbox: std.ArrayListUnmanaged(replica.Said) = .empty, taken: std.ArrayListUnmanaged(replica.Said) = .empty, ended: bool = false, + /// The size the window last posted while its view is not that size + /// yet (the session has not taken it, or speculation stopped at it): + /// posted once, not again each pass while it waits. + posted: ?@FieldType(pardes.Event, "resize") = null, fn deinit(cl: *Client) void { cl.pending.deinit(cl.gpa); @@ -1330,7 +1334,11 @@ const OwnView = struct { if (scrollRows(g, v.in, v.s.gpa)) v.s.client.?.link.dirty = true; if (fitTaglineFont(g, core.settings.font.tagline_percent)) v.s.client.?.link.dirty = true; const geom = windowCells(g); - if (resizeOf(core.view(), geom.cols, geom.rows, g.cell_w, g.cell_h, g.tagline_width, g.tagline_height)) |ev| v.in.post(ev); + const cl = v.s.client.?; + if (resizeOf(core.view(), geom.cols, geom.rows, g.cell_w, g.cell_h, g.tagline_width, g.tagline_height)) |ev| { + if (cl.posted == null or !std.meta.eql(cl.posted.?, ev.resize)) v.in.post(ev); + cl.posted = ev.resize; + } else cl.posted = null; if (v.pointer) refreshPresentedPointer(g, v.in); runDemo(g, v.in, core); if (v.s.test_mode) { @@ -1424,6 +1432,7 @@ fn clientSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_ g.hit_core = core; frame_probe = &core.frames; link.reset(r, &joined); + client.posted = null; client.ended = false; // ponytail: why it joined again is the window's title (and its // log) until a key, where a terminal's client draws it over its |
