summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-01 16:06:30 -0300
committerGabriel Schneider <[email protected]>2026-11-01 16:06:30 -0300
commitb421b07697cc4c9834e2db401ccf3083eab346ae (patch)
tree680df7b6aa4c7928f38d32008e6dfccf7669189f /src/gui/gui.zig
parentd79c5de9dbf77c06fb2174782093051786be2153 (diff)
downloadpardes-b421b07697cc4c9834e2db401ccf3083eab346ae.tar.gz
pardes-b421b07697cc4c9834e2db401ccf3083eab346ae.zip
gui: Upgrade refused while the display has no screen (SDL lists none: the screen off and its outputs gone), in words, the session as it was: the new process starts SDL's video afresh and failed there (`SDL_Init: The video driver did not add any displays`), after the dump and the exec, so the session ended, its shell left to the daemon (a window session upgraded with the screen off, 2026-11-01; its dump restored it)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index d3acf454..50baf9ec 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -4490,6 +4490,12 @@ const Shell = struct {
const core = s.core;
var why: [800]u8 = undefined;
const path = upgrade.exe() orelse return core.reportFailure(pane, "Upgrade: this process does not know the path it was started from");
+ // The new process starts SDL's video afresh, and that fails with no
+ // display at all (the screen off and its outputs gone): it ended the
+ // session (a detached one's hidden window needs one too).
+ var displays: c_int = 0;
+ if (c.SDL_GetDisplays(&displays)) |list| c.SDL_free(list);
+ if (displays == 0) return core.reportFailure(pane, "Upgrade: the display has no screen now (off, or gone), and the new build could not open its window; this session stays as it is until one is back");
// 9P is served while the new binary is asked, and not after.
pardes.turn.rest();
const checked = upgrade.check(path, &why);