summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index dd21680f..d3acf454 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -2752,7 +2752,7 @@ fn remoteSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_
defer have_store.deinit();
const have: ?*replica.Have = if (far) &have_store else null;
var dial_t0 = std.Io.Clock.awake.now(io).nanoseconds;
- var joined = replica.dial(gpa, to.path, to.session, &why, have) orelse Said.no(io, "{s}", .{std.mem.sliceTo(&why, 0)});
+ var joined = replica.dial(gpa, to.path, to.session, &why, have, null) orelse Said.no(io, "{s}", .{std.mem.sliceTo(&why, 0)});
if (joined.semantics != wire.semantics) Said.no(io, "{s}", .{replica.Link.upgrade_words});
const allocs = pardes.memory.init(gpa);
@@ -2878,7 +2878,7 @@ fn remoteSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_
if (r.diverged != null) link.quit = true;
}
if (init.environ_map.get("PARDES_REPLICA_STATS")) |file| link.writeStats(file);
- if (!link.gone) replica.bye(joined.fd);
+ if (!link.gone) replica.bye(joined.fd, r.diverged != null);
// The reader ends with the link: what it took meanwhile is let go.
_ = libc.shutdown(joined.fd, 2);
reader.join();
@@ -2901,7 +2901,7 @@ fn remoteSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_
// The session again, the core it leaves held meanwhile.
if (have) |h| h.leaving(r.core());
dial_t0 = std.Io.Clock.awake.now(io).nanoseconds;
- joined = replica.Link.redial(gpa, to.path, to.session, &why, have, r.diverged == null) orelse Said.no(io, "could not join again: {s}", .{std.mem.sliceTo(&why, 0)});
+ joined = replica.Link.redial(gpa, to.path, to.session, &why, have, r.diverged == null, joined.view) orelse Said.no(io, "could not join again: {s}", .{std.mem.sliceTo(&why, 0)});
if (have) |h| h.left();
r.deinit();
r = replica.Link.load(gpa, &joined, o, &why, have) orelse Said.no(io, "{s}", .{std.mem.sliceTo(&why, 0)});
@@ -4553,13 +4553,14 @@ const Shell = struct {
}
/// An upgraded session's views, a window each again: the Gui's is the
- /// live view's, the others open as `--attach` opens one.
+ /// live view's, the others open as `--attach` opens one; a replica
+ /// client's, kept for its rejoin (views.away), none.
fn resumeWindows(s: *Shell) void {
const live = s.core.view;
s.gview = live;
for (0..pardes.views.max) |i| {
const k: u8 = @intCast(i);
- if (k != live and pardes.views.isOpen(s.core, k)) s.openAnotherWindow(k);
+ if (k != live and pardes.views.isOpen(s.core, k) and !pardes.views.isAway(s.core, k)) s.openAnotherWindow(k);
s.windowed |= @as(u8, 1) << @intCast(live);
}
s.core.toView(live);
@@ -5362,7 +5363,7 @@ fn deliverNote(ctx: *anyopaque, note: daemon.Note) void {
q.push(.{ .adopted = .{ .pid = 0, .fd = -1 } });
},
// Joined at the next step boundary (Peers, any thread).
- .replica => |fd| s.peers.handed(fd),
+ .replica => |j| s.peers.handed(j.fd, j.view),
}
}