summaryrefslogtreecommitdiff
path: root/dev/gui/gui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-21 03:29:45 -0300
committerGabriel Schneider <[email protected]>2026-11-21 04:32:01 -0300
commitfe0aa07c18a9fd5ca6bdcb78e9354a2745e32298 (patch)
treedc1c01af7fa00f1ea809d618a5f18365e705f326 /dev/gui/gui.zig
parentf395894dd27c2d7a78c14f21b3c857d90db13800 (diff)
downloadpardes-fe0aa07c18a9fd5ca6bdcb78e9354a2745e32298.tar.gz
pardes-fe0aa07c18a9fd5ca6bdcb78e9354a2745e32298.zip
client: what the pair's last rounds left, each a test first: a window client exec'd at its session's Upgrade comes back the size it was, not the default (runtime/client.zig `execAgain` passed `--attach=` alone, so the new process made a 1120x720 window: a `--geometry=900x560` pair's session went from 56x16 to 70x20 after an Upgrade to another build, with the variable or without (any `pardes-gui attach`); now the window's size at the exec, SDL_GetWindowSize, as `--geometry=WxH`); a pair's client exec'd at an Upgrade waits for its session at `ended` as before the exec (tui.zig and gui.zig `runClient` asked `opts.pair`, which the exec'd `--attach=` client has not: now every near client waits, a non-child answers ECHILD at once; not seen to fail here: the subreaper took the session first); tests in test/daemon.py: `pair_upgrade_views` (plain, --pair: two clients' own views, the pair's scroll and the attach's focus, the same after a same-build Upgrade: the screens by pyte, the focus by where typing lands: passed before this change too), `pair_exec_reaps`, `far_exec` (a far client, PARDES_REPLICA_FAR by the socket's path, execs the build at its start path and agrees after: passed before too), `pair_window_geometry` (offscreen, not test mode: failed before), the last three in --upgrade OLD NEW
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/gui/gui.zig')
-rw-r--r--dev/gui/gui.zig14
1 files changed, 10 insertions, 4 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index d10173b4..d779cf47 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -1429,16 +1429,22 @@ fn clientSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_
.gone => Said.no(io, "'{s}' let this client go (a Detach in it, or the session's end)", .{to.session}),
.failed => Said.no(io, "{s}", .{start.said()}),
// A new process's window: the build at its start path, exec'd.
- .upgrade => |view| Said.no(io, "{s}", .{client_loop.execAgain(&start, view)}),
+ .upgrade => |view| {
+ // Its new window the size this one has now.
+ var size: [2]c_int = .{ 0, 0 };
+ _ = c.SDL_GetWindowSize(g.window, &size[0], &size[1]);
+ Said.no(io, "{s}", .{client_loop.execAgain(&start, view, size)});
+ },
.left => {
var said: [600]u8 = undefined;
std.Io.File.stderr().writeStreamingAll(io, std.fmt.bufPrint(&said, "pardes-gui: detached from '{s}', which is still running; come back with `pardes-gui attach {s}`\n", .{ to.session, to.session }) catch "pardes-gui: detached\n") catch {};
std.process.exit(0);
},
.ended => |code| {
- // A pair's window is its session's parent: its status once it
- // is gone, as the terminal's (tui.zig `runClient`).
- if (opts_in.pair != null) {
+ // A pair's window is its session's parent, an exec'd one too:
+ // its status once it is gone, as the terminal's (tui.zig
+ // `runClient`).
+ if (!to.far) {
var status: c_int = 0;
while (libc.waitpid(@intCast(start.joined.pid), &status, 0) < 0 and libc.errno(-1) == .INTR) {}
}