diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-29 22:56:07 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-29 23:37:00 -0300 |
| commit | 370913ae34c69b7958911c6146612c77275f6ebf (patch) | |
| tree | 61e4fd328e104afbb381d2fd161029d1be637aa7 /src/gui/gui.zig | |
| parent | ddcfd860ef05c37f5536038d8828cc81c0c4125c (diff) | |
| download | pardes-370913ae34c69b7958911c6146612c77275f6ebf.tar.gz pardes-370913ae34c69b7958911c6146612c77275f6ebf.zip | |
upgrade: a newer build at the path a session started from is said at a focus-in, once a build, the path read just after the first frame (off a startup's way); an upgraded process lets the binary it replaced go (held, its deleted file kept its blocks) and sweeps its old image's prompt files (kept for an exec that failed); test/daemon.py --upgrade asks through /ctl, checks the fds and prompt files level, and runs on FreeBSD (procstat, the daemon's registry, no kept old binary there)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/gui/gui.zig')
| -rw-r--r-- | src/gui/gui.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 24061251..e4d69281 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -2502,6 +2502,7 @@ fn localSession( while (!core.quit) { pardes.turn.bump(&pardes.turn.restores); try core.pump(host); + upgrade.locate(); // Asked in the step (the word), done between steps: the session whole. if (shell.upgrade_asked) |pane| shell.upgradeNow(pane); // A window asked for again, or an adopted shell, from the daemon's @@ -3138,7 +3139,10 @@ fn dispatch(g: *Gui, in: *Input, sev: *const c.SDL_Event) void { in.close(); }, c.SDL_EVENT_WINDOW_CLOSE_REQUESTED => in.close(), - c.SDL_EVENT_WINDOW_FOCUS_GAINED => in.post(.{ .focus = true }), + c.SDL_EVENT_WINDOW_FOCUS_GAINED => { + in.post(.{ .focus = true }); + if (in.core) |core| upgrade.noticeNewer(core); + }, c.SDL_EVENT_WINDOW_FOCUS_LOST => in.post(.{ .focus = false }), c.SDL_EVENT_WINDOW_MOUSE_LEAVE => { g.pointer_present = false; @@ -4060,7 +4064,6 @@ const Shell = struct { if (!upgrade.writeDump(at, bytes)) break :failed std.fmt.bufPrint(&why, "Upgrade: the session's dump could not be written to {s}; it stays as it is", .{at[0..@min(at.len, 600)]}) catch "Upgrade: its dump could not be written"; rec.dump = at; rec.old = upgrade.openSelf(); - host_io.Shell.unlinkOwnedRcs(); daemon.upgraded(); if (s.fs) |f| f.flushOut(); const err_words = upgrade.exec(s.gpa, path, -1, &rec); |
