summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/replica.zig5
-rw-r--r--runtime/session.zig6
2 files changed, 11 insertions, 0 deletions
diff --git a/core/replica.zig b/core/replica.zig
index 49dc7f7b..70335cfd 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -2141,6 +2141,10 @@ pub const Peers = struct {
/// true; its session's frontend puts the user's terminal back then,
/// and lets it go either way (tui.zig `Own.sent`), and clears this.
pair_left: ?bool = null,
+ /// Its pair's first client's terminal or window found again (a focus
+ /// in): the session asks whether a newer build is installed, as its own
+ /// frontend asks at its own (runtime/session.zig), and clears this.
+ pair_focused: bool = false,
/// An Upgrade told its clients so (`refuseAll`): a connection handed
/// over before its exec is told the same, never closed by the exec
/// unanswered. Its exec failed: the next boundary takes joins again.
@@ -2296,6 +2300,7 @@ pub const Peers = struct {
// it read, its unit (part B terminal notes' order).
ps.screensOut(core, .flush);
core.toView(peer.view);
+ if (peer.pair and in.event == .focus and in.event.focus) ps.pair_focused = true;
ps.t.stamp = stampOf(in);
core.update(in.event);
core.step();
diff --git a/runtime/session.zig b/runtime/session.zig
index 890302b1..d8c7cd02 100644
--- a/runtime/session.zig
+++ b/runtime/session.zig
@@ -136,6 +136,12 @@ pub fn Loop(comptime Frontend: type) type {
l.peers.boundary(l.core);
// Before a pair's end: its client's terminal put back (P48).
fe.sent();
+ // A pair's client stands for the frontend it was started
+ // for: at its focus in, a newer build said (upgrade.zig).
+ if (l.peers.pair_focused) {
+ l.peers.pair_focused = false;
+ upgrade.noticeNewer(l.core);
+ }
// A pair's session with no daemon ends with its last link:
// nothing could attach to it again; with one, when its last
// client left with a close (not a loss) and it is not kept.