summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);