summaryrefslogtreecommitdiff
path: root/dev/gui
diff options
context:
space:
mode:
Diffstat (limited to 'dev/gui')
-rw-r--r--dev/gui/gui.zig16
1 files changed, 11 insertions, 5 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index 521f685f..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) {}
}
@@ -2501,7 +2507,7 @@ const Shell = struct {
core.settle();
// Its replica clients told, their views gone before the dump: each
// dials the session again once it is back.
- s.peers.refuseAll(core, "the session is upgrading to another build of pardes");
+ s.peers.refuseAll(core);
var rec: upgrade.Record = .{ .link = daemon.link, .window = s.gui != null, .exe = path };
s.ptys.record(&rec);
var at_buf: [1024:0]u8 = undefined;