summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-23 11:00:44 -0300
committerGabriel Schneider <[email protected]>2026-10-23 17:10:58 -0300
commit80314064f6e81c8828340e010202b446f0e1f36d (patch)
treeaa56e86238ac9397055f601db924868bb6511538 /src/gui/gui.zig
parenta53a1aafb9804e943bdcd720c2bb688ecb90a888 (diff)
downloadpardes-80314064f6e81c8828340e010202b446f0e1f36d.tar.gz
pardes-80314064f6e81c8828340e010202b446f0e1f36d.zip
Audit (misc): std mkdir -p and JSON escaping, a 9P late failure's errno from ctl.failureErrno, dead switches and dumpHex out
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 2d01db33..795ea743 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -54,11 +54,6 @@ const Ground = struct {
}
};
-fn ground(theme_bg: ?[3]u8, transparent: bool) Ground {
- if (theme_bg) |rgb| return .opaqueRgb(rgb);
- return .{ .rgb = bg_default, .clear = transparent };
-}
-
const p9_arrow_clr = [32]u8{
0xFF, 0xFF, 0x80, 0x01, 0x80, 0x02, 0x80, 0x0C,
0x80, 0x10, 0x80, 0x10, 0x80, 0x08, 0x80, 0x04,
@@ -1769,7 +1764,6 @@ const Gui = struct {
capture_xfer_size: u32 = 0,
soft_present: bool = false,
- transparent: bool = false,
surface_opacity: bool = false,
applied_window_opacity: u8 = 100,
soft_renderer: ?*c.SDL_Renderer = null,
@@ -2187,7 +2181,7 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, attach: ?[]const u
const native_wayland = !test_mode and std.mem.eql(u8, std.mem.span(c.SDL_GetCurrentVideoDriver()), "wayland");
// Background-only opacity needs per-pixel alpha; whole-window compositor
// opacity would dim the text as well. SDL requires this flag at creation.
- const surface_opacity = config.gui_transparent or native_wayland;
+ const surface_opacity = native_wayland;
if (surface_opacity) win_flags |= c.SDL_WINDOW_TRANSPARENT;
const window = c.SDL_CreateWindow("pardes", 1120, 720, win_flags) orelse {
log.err("SDL_CreateWindow: {s}", .{c.SDL_GetError()});
@@ -2391,7 +2385,6 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, attach: ?[]const u
.capture_series = test_mode and env.get("PARDES_TEST_SERIES") != null,
.capture_dir = capture_dir orelse "",
.soft_present = soft_present,
- .transparent = config.gui_transparent,
.surface_opacity = surface_opacity,
.soft_renderer = soft_renderer,
};
@@ -6092,7 +6085,7 @@ fn renderFrame(
coverFrame(previous_covered, surface.cols, surface.rows, surface.previous_body_layers, surface.previous_tag_layers, surface.previous_regions);
try buildDecor(g, gpa, surface, &groups, layout, win_w, win_h, cursors_shown);
- const page = ground(chrome.page, g.transparent);
+ const page: Ground = .opaqueRgb(chrome.page orelse bg_default);
const background_opacity = backgroundOpacity(g.applied_window_opacity);
var color_target = std.mem.zeroes(c.SDL_GPUColorTargetInfo);
color_target.texture = scene;
@@ -8449,7 +8442,7 @@ fn softPresentFrame(g: *Gui, cmd: *c.SDL_GPUCommandBuffer, target: *c.SDL_GPUTex
// The cell shader already produced premultiplied backgrounds with opaque
// foreground ink. Copy that alpha unchanged; never modulate the full frame.
_ = c.SDL_SetRenderDrawBlendMode(renderer, c.SDL_BLENDMODE_NONE);
- _ = c.SDL_SetRenderDrawColor(renderer, 0, 0, 0, if (g.transparent or g.surface_opacity) 0 else 255);
+ _ = c.SDL_SetRenderDrawColor(renderer, 0, 0, 0, if (g.surface_opacity) 0 else 255);
_ = c.SDL_RenderClear(renderer);
_ = c.SDL_RenderTexture(renderer, texture, null, null);
_ = c.SDL_RenderPresent(renderer);