From b421b07697cc4c9834e2db401ccf3083eab346ae Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 1 Nov 2026 16:06:30 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/gui/gui.zig | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.3