summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig191
1 files changed, 13 insertions, 178 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 28f5e695..2c2f53c4 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -12,9 +12,7 @@ const config = @import("../config.zig");
const look = @import("../look.zig");
const message = pardes.Messages.Message;
const file_watch = @import("../file_watch.zig");
-const ShaderBuild = @import("../ShaderBuild.zig");
const deck = @import("deck.zig");
-const Post = @import("Post.zig");
const pet = @import("pet.zig");
const fonts = @import("../fonts.zig"); // the fallback faces
const selection_pipe = @import("../selection_pipe.zig");
@@ -806,7 +804,7 @@ const Pty = struct {
const Queue = host_io.Inbox;
/// Wakes a blocking SDL_WaitEventTimeout from another thread: a push to
-/// the queue, a link's message, a post chain's compile done (ShaderBuild).
+/// the queue, a link's message.
fn sdlWake(_: ?*anyopaque) void {
var sev = std.mem.zeroes(c.SDL_Event);
sev.type = c.SDL_EVENT_USER;
@@ -1181,13 +1179,6 @@ const Gui = struct {
blink_due: bool = false,
no_blink: bool = false,
cursor_quad_alpha: f32 = 0,
- scene_tex: ?*c.SDL_GPUTexture = null,
- scene_tex_w: u32 = 0,
- scene_tex_h: u32 = 0,
- scene_failures: u8 = 0,
- scene_target_failed: bool = false,
- /// The post chain, run over the frame in scene_tex.
- post: Post = .{},
pointer_present: bool = false,
arrow_cursor: ?*c.SDL_Cursor = null,
link_cursor: ?*c.SDL_Cursor = null,
@@ -1237,8 +1228,8 @@ const Gui = struct {
};
/// The Gui's fields that are each window's own, one a view (views.zig):
-/// the window and its presenting, its scroll and glide, its scene and post
-/// chain, its pointer, its blink, its images as presented, its capture. The
+/// the window and its presenting, its scroll and glide, its pointer, its
+/// blink, its images as presented, its capture. The
/// device, the atlas, the font and the pipelines are every window's. The
/// Gui holds the live window's; the others wait in `Shell.windows`.
const window_fields = [_][:0]const u8{
@@ -1247,8 +1238,7 @@ const window_fields = [_][:0]const u8{
"scroll_body_h", "scroll_held_px", "scroll_col", "scroll_row", "scroll_delta",
"scroll_lag", "scroll_edge", "scroll_edge_len", "scroll_notch", "program_wheel",
"glide", "pace_ns", "sel_glow", "hover_glow", "frame_arrival_ns",
- "blink_due", "cursor_quad_alpha", "scene_tex", "scene_tex_w", "scene_tex_h",
- "scene_failures", "scene_target_failed", "post", "pointer_present", "pointer_shape",
+ "blink_due", "cursor_quad_alpha", "pointer_present", "pointer_shape",
"pointer_cell", "presented_images", "prepared_images", "touch",
"live_ctrl", "live_alt", "applied_window_opacity", "capture_tex", "capture_tex_w",
"capture_tex_h", "capture_xfer", "capture_xfer_size", "captured", "capture_dir",
@@ -1288,10 +1278,8 @@ fn freshWindow(g: *Gui) void {
/// What a window held of its own let go (closeWindow lets the window go).
fn releaseWindowParts(g: *Gui, gpa: std.mem.Allocator) void {
- if (g.scene_tex) |texture| c.SDL_ReleaseGPUTexture(g.device, texture);
if (g.capture_tex) |texture| c.SDL_ReleaseGPUTexture(g.device, texture);
if (g.capture_xfer) |transfer| c.SDL_ReleaseGPUTransferBuffer(g.device, transfer);
- g.post.deinit(gpa, g.device);
g.glide.deinit(gpa);
gpa.free(g.scroll_edge);
g.presented_images.deinit(gpa);
@@ -1903,7 +1891,6 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, headless: bool, di
if (g.vxfer) |transfer| c.SDL_ReleaseGPUTransferBuffer(device, transfer);
if (g.image_vbuf) |buffer| c.SDL_ReleaseGPUBuffer(device, buffer);
if (g.image_vxfer) |transfer| c.SDL_ReleaseGPUTransferBuffer(device, transfer);
- if (g.scene_tex) |texture| c.SDL_ReleaseGPUTexture(device, texture);
if (g.capture_tex) |texture| c.SDL_ReleaseGPUTexture(device, texture);
if (g.capture_xfer) |transfer| c.SDL_ReleaseGPUTransferBuffer(device, transfer);
if (g.gamepad) |pad| c.SDL_CloseGamepad(pad);
@@ -1920,7 +1907,6 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, headless: bool, di
g.prepared_images.deinit(gpa);
g.cover.deinit(gpa);
g.decor.deinit(gpa);
- g.post.deinit(gpa, device);
}
defer c.SDL_ReleaseGPUGraphicsPipeline(device, image_pipeline);
defer if (g.font_bytes.len != 0) gpa.free(g.font_bytes); // set by Font, if it ran
@@ -2082,7 +2068,6 @@ fn localSession(
.test_hz = if (std.c.getenv("PARDES_TEST_HZ")) |hz| @max(1, std.fmt.parseInt(u64, std.mem.span(hz), 10) catch 60) else 60,
};
defer shell.shutdownPtys();
- defer shell.shaders.deinit(gpa, inotify_fd, &watches);
// A virtual clock never blinks: goldens and feel series hold still.
g.no_blink = shell.test_clock != null;
frame_probe = &core.frames;
@@ -2388,7 +2373,6 @@ fn remoteSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_
.test_mode = test_mode,
.remote = &client,
};
- defer shell.shaders.deinit(gpa, -1, &watches);
g.no_blink = test_mode;
defer g.hit_core = null;
_ = c.SDL_StartTextInput(g.window);
@@ -2421,10 +2405,6 @@ fn remoteSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_
while (!link.quit) {
core.frames.period_ns = refreshNs(g);
syncLigatures(g, core);
- {
- var passes: [Post.max]ShaderBuild.Pass = undefined;
- g.post.sync(gpa, g.device, g.swapchain_format, shell.shaders.view(&core.settings.post, &passes), shell.shaders.revision, core);
- }
var own: OwnView = .{ .g = g, .in = &in, .s = &shell, .pointer = drew };
r.within(&own, OwnView.run);
client.feed();
@@ -2859,16 +2839,7 @@ fn dispatch(g: *Gui, in: *Input, sev: *const c.SDL_Event) void {
},
else => {},
}
- // What the post chain sees of the pointer and the focus.
switch (sev.type) {
- c.SDL_EVENT_MOUSE_MOTION => {
- const at = windowPointToPixels(windowGeometry(g.window), sev.motion.x, sev.motion.y);
- g.post.mouse(at.x, at.y, null);
- },
- c.SDL_EVENT_MOUSE_BUTTON_DOWN, c.SDL_EVENT_MOUSE_BUTTON_UP => {
- const at = windowPointToPixels(windowGeometry(g.window), sev.button.x, sev.button.y);
- g.post.mouse(at.x, at.y, sev.button.down);
- },
c.SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED => {
updateDisplayScale(g.window);
// Underlines are drawn into the glyphs a logical pixel thick.
@@ -2877,8 +2848,6 @@ fn dispatch(g: *Gui, in: *Input, sev: *const c.SDL_Event) void {
r.link.dirty = true;
} else in.core.needs_frame = true;
},
- c.SDL_EVENT_WINDOW_FOCUS_GAINED => g.post.focus(true),
- c.SDL_EVENT_WINDOW_FOCUS_LOST => g.post.focus(false),
else => {},
}
switch (sev.type) {
@@ -3216,10 +3185,9 @@ test "tagline pointer mapping retains physical grips and carries logical text co
try std.testing.expectEqual(pardes.TagKind.workspace, topbar.tag_hit.?.kind);
}
-test "a click at the window's corner lands in the corner cell with a post chain on" {
+test "a click at the window's corner lands in the corner cell" {
const core = try pardes.Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 24 });
defer core.deinit();
- try std.testing.expect(core.settings.post.set(.crt, "", true));
var g = testGui(10, 20, 6, 12);
const geometry: WindowGeometry = .{ .window_w = 400, .window_h = 240, .pixel_w = 800, .pixel_h = 480 };
const last = mouseCellWithGeometry(&g, core, 399.9, 239.9, geometry);
@@ -3230,9 +3198,6 @@ test "a click at the window's corner lands in the corner cell with a post chain
try std.testing.expectEqual(@as(u16, 0), first.row);
}
-/// Where a window point lands: the cell drawn under it. Input is identity:
-/// no post pass moves a pixel (the bundled Crt has no barrel), so a click
-/// is exactly where it looks.
/// A wheel turned over grid cell `mc` (SDL's sign: up positive): the
/// part of dispatch after the pointer is placed, so a test can turn it.
fn wheelAt(g: *Gui, in: *Input, w: WheelTurn, mc: MouseCell) void {
@@ -3448,8 +3413,6 @@ const Shell = struct {
pipe_tasks: *PipeTasks,
inotify_fd: c_int,
watches: *file_watch.Table,
- /// The post chain's files as SPIR-V.
- shaders: ShaderBuild = .{},
threads_ok: bool = false,
test_mode: bool = false,
feed: StdinFeed = .{},
@@ -3901,7 +3864,6 @@ const Shell = struct {
.window => if (s.gui != null) s.openAnotherWindow(null) else s.openTheWindow(),
.adopted => |a| s.adoptions.adoptShell(s.core, a.pid, a.fd),
};
- if (check_files) s.shaders.recheck();
if (check_files and file_watch.reloadChanged(s.core, s.io, s.gpa, s.watches))
s.queue.push(.files_changed);
}
@@ -3931,20 +3893,14 @@ fn waitInput(ctx: ?*anyopaque, timeout_ms: u32) void {
// shell's queue raises for a terminal's output, a completion, a file
// system request. What the shell moves or times itself polls every
// frame: a smooth scroll, a gamepad's sticks, the test stdin feed,
- // a post chain that moves on its own (ShaderAnimation), a present
- // to retry. A minimized window sleeps through the core's animation
+ // a present to retry. A minimized window sleeps through the core's animation
// too: nothing shows it, and it is caught up at once when the window
// is back.
- const polls = g.scroll_lag != 0 or g.scroll_delta != 0 or g.scroll_notch != 0 or g.glide.moving() or g.gamepad != null or s.test_mode or core.needs_frame or
- g.post.animating(core.settings.shader_animation);
+ const polls = g.scroll_lag != 0 or g.scroll_delta != 0 or g.scroll_notch != 0 or g.glide.moving() or g.gamepad != null or s.test_mode or core.needs_frame;
const minimized = !s.test_mode and c.SDL_GetWindowFlags(g.window) & (c.SDL_WINDOW_MINIMIZED | c.SDL_WINDOW_OCCLUDED) != 0;
// A latency trace is fed on stdin, whose poll below paces the loop:
// waiting here too would make every tick cost two frames.
- // A chain that moves on its own wakes once a display refresh.
- const poll_ms: c_int = if (g.post.animating(core.settings.shader_animation))
- @intCast(@max(1, refreshNs(g) / std.time.ns_per_ms))
- else
- 16;
+ const poll_ms: c_int = 16;
const waited: c_int = if (latency_fd >= 0) 0 else if (minimized) -1 else if (timeout_ms != 0) @min(@as(c_int, @intCast(@min(timeout_ms, std.math.maxInt(c_int)))), if (polls) poll_ms else std.math.maxInt(c_int)) else if (polls) poll_ms else -1;
// The cursor's blink is the shell's to time (Chrome.cursor_idle_ms):
// a frame a loop through an edge, else a wake at the next one; none
@@ -4161,17 +4117,7 @@ fn pollFrame(ctx: ?*anyopaque) void {
const geom = windowCells(g);
if (updateCoreResize(core, geom.cols, geom.rows, g.cell_w, g.cell_h, g.tagline_width, g.tagline_height)) resetScroll(g);
stepScroll(g, core, s.gpa);
- _ = s.shaders.sync(s.gpa, s.io, core, s.inotify_fd, s.watches, sdlWake);
- {
- var passes: [Post.max]ShaderBuild.Pass = undefined;
- g.post.sync(s.gpa, g.device, g.swapchain_format, s.shaders.view(&core.settings.post, &passes), s.shaders.revision, core);
- }
if (s.test_mode) writeTestStatus(g, core, s.presented);
- // Between the core's frames, a chain that moves on its own redraws
- // alone, once a refresh of the display the window is on (a millisecond
- // early is on time: the wait that paces it is in whole milliseconds).
- if (g.post.animating(core.settings.shader_animation) and !core.needs_frame and s.presented and
- c.SDL_GetTicksNS() -| g.post.last_ns + std.time.ns_per_ms >= refreshNs(g)) redrawPost(g, s.gpa);
// A blink edge: the last frame again, the cursor's alpha moved on.
if (g.blink_due and !core.needs_frame and s.presented) if (s.surface) |frame| {
g.blink_due = false;
@@ -4350,8 +4296,6 @@ fn present(ctx: ?*anyopaque, surface: *const pardes.Surface) void {
const frame = surface;
s.surface = frame;
g.frame_arrival_ns = monoNs();
- const scene_requested = g.post.ready();
- if (!scene_requested) g.scene_failures = 0;
s.presented = renderFrame(g, s.gpa, core, frame) catch |err| blk: {
log.err("render: {t}", .{err});
break :blk false;
@@ -4360,16 +4304,6 @@ fn present(ctx: ?*anyopaque, surface: *const pardes.Surface) void {
// the next event. A few retries only: a minimized window never gets one.
s.skipped_presents = if (s.presented) 0 else s.skipped_presents +| 1;
if (!s.presented and s.skipped_presents <= 3) core.present_skipped = true;
- if (g.scene_target_failed) {
- g.scene_failures +|= 1;
- log.err("scene target unavailable (attempt {d}/3)", .{g.scene_failures});
- if (g.scene_failures >= 3) {
- // ponytail: a client's window keeps asking (its core is the
- // session's to change).
- if (s.remote == null) core.disableSceneEffects();
- g.scene_failures = 0;
- }
- } else if (scene_requested and s.presented) g.scene_failures = 0;
}
fn postPresent(ctx: ?*anyopaque) void {
@@ -5852,7 +5786,6 @@ fn renderFrame(
};
if (cursor) |value| _ = c.SDL_SetCursor(value);
}
- g.scene_target_failed = false;
g.words.memo = .{}; // positional, and this frame's cells are new
const cmd = c.SDL_AcquireGPUCommandBuffer(g.device) orelse return false;
var command_consumed = false;
@@ -5870,15 +5803,6 @@ fn renderFrame(
const win_w: f32 = @floatFromInt(sw);
const win_h: f32 = @floatFromInt(sh);
- // The post chain runs from the scene texture, over a local frame or an
- // attached session's alike.
- var scene_on = g.post.ready();
- if (scene_on) ensureSceneTexture(g, sw, sh) catch {
- g.scene_target_failed = true;
- scene_on = false;
- };
- const scene: *c.SDL_GPUTexture = if (scene_on) g.scene_tex.? else target;
-
// The frame's CPU side: groups, decor, cover and every instance, up to
// their upload.
const build_zone = tracy.zone(@src(), "gui frame build");
@@ -5962,7 +5886,7 @@ fn renderFrame(
const page = 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;
+ color_target.texture = target;
color_target.clear_color = .{
.r = @as(f32, @floatFromInt(page[0])) / 255.0 * background_opacity,
.g = @as(f32, @floatFromInt(page[1])) / 255.0 * background_opacity,
@@ -6276,25 +6200,6 @@ fn renderFrame(
drawOverlayGpu(g, cmd, rp, overlay_count);
c.SDL_EndGPURenderPass(rp);
- if (scene_on) {
- var boxes: [max_cursors]CursorBox = undefined;
- const cursors = if (cursors_shown) cursorBoxes(g, surface, layout, win_h, &boxes) else 0;
- var spare: [Post.max_spare][4]f32 = undefined;
- g.post.describe(.{
- .cursor = if (cursors > 0) boxes[0] else null,
- .spare = spare[0..postSpare(surface, layout, &spare)],
- .background = chrome.page orelse bg_default,
- .foreground = chrome.fg orelse fg_default,
- .selection_foreground = core.theme().sel_fg,
- .selection_background = core.theme().sel_bg,
- });
- const chain_zone = tracy.zone(@src(), "post chain");
- defer chain_zone.end();
- g.post.scale = display_scale;
- g.post.draw(g.device, cmd, g.linear_sampler, g.swapchain_format, g.scene_tex.?, target, sw, sh, c.SDL_GetTicksNS(), background_opacity >= 1) catch {
- g.scene_target_failed = true;
- };
- }
command_consumed = true;
const shown = try finishFrame(g, gpa, cmd, frame_target, if (groups.tracks != 0) groups.items[1].track.?.frame else null);
if (shown and groups.tracks == 0) rememberPresentedImages(g, gpa, surface);
@@ -6340,26 +6245,6 @@ fn finishFrame(g: *Gui, gpa: std.mem.Allocator, cmd: *c.SDL_GPUCommandBuffer, ta
return c.SDL_SubmitGPUCommandBuffer(cmd);
}
-/// Redraw level A (docs ยง5.5): the post chain alone, over the frame the core
-/// last drew, for a pass that moves on its own. No core render, no cell.
-fn redrawPost(g: *Gui, gpa: std.mem.Allocator) void {
- const scene = g.scene_tex orelse return;
- const cmd = c.SDL_AcquireGPUCommandBuffer(g.device) orelse return;
- const target = (acquireTarget(g, cmd, g.scene_tex_w, g.scene_tex_h) catch null) orelse {
- _ = c.SDL_SubmitGPUCommandBuffer(cmd);
- return;
- };
- // A window the retained frame no longer fits waits for the core's.
- if (target.w != g.scene_tex_w or target.h != g.scene_tex_h) {
- _ = c.SDL_SubmitGPUCommandBuffer(cmd);
- return;
- }
- const zone = tracy.zone(@src(), "post chain redraw");
- g.post.draw(g.device, cmd, g.linear_sampler, g.swapchain_format, scene, target.texture, target.w, target.h, c.SDL_GetTicksNS(), backgroundOpacity(g.applied_window_opacity) >= 1) catch {};
- zone.end();
- _ = finishFrame(g, gpa, cmd, target, null) catch {};
-}
-
const ResolvedCell = struct {
slot: Slot,
fg: [3]u8,
@@ -8105,15 +7990,6 @@ pub fn texture2d(device: *c.SDL_GPUDevice, format: c.SDL_GPUTextureFormat, usage
return c.SDL_CreateGPUTexture(device, &info);
}
-fn ensureSceneTexture(g: *Gui, width: u32, height: u32) !void {
- if (g.scene_tex != null and g.scene_tex_w == width and g.scene_tex_h == height) return;
- const next = texture2d(g.device, g.swapchain_format, c.SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | c.SDL_GPU_TEXTUREUSAGE_SAMPLER, width, height) orelse return error.GpuCreate;
- if (g.scene_tex) |texture| c.SDL_ReleaseGPUTexture(g.device, texture);
- g.scene_tex = next;
- g.scene_tex_w = width;
- g.scene_tex_h = height;
-}
-
fn ensureCaptureTexture(g: *Gui, width: u32, height: u32) !void {
if (g.capture_tex != null and g.capture_tex_w == width and g.capture_tex_h == height) return;
const next = texture2d(g.device, g.swapchain_format, c.SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, width, height) orelse return error.GpuCreate;
@@ -9925,47 +9801,7 @@ test "a body tells its first line, and lapis's dots under it move a quarter as f
try std.testing.expectEqual(@as(f32, 0), decor.parallaxAt(900, 10));
}
-/// What a bundled post pass leaves alone (Post.Frame.spare), in window
-/// pixels: every tag with its grip, the column and workspace tags, and the
-/// notices, the chrome the focus indicators live in. A grip, the gap after
-/// it and the tag beside it are one rectangle; past the list's end the last
-/// grows to cover the rest.
-fn postSpare(surface: *const pardes.Surface, layout: CellLayout, out: *[Post.max_spare][4]f32) usize {
- var n: usize = 0;
- for (surface.regionList()) |region| {
- switch (region.kind) {
- .grip, .tag, .notice, .column_grip, .column_tag, .workspace_tag => {},
- else => continue,
- }
- if (region.rect.w == 0 or region.rect.h == 0) continue;
- const rect: [4]f32 = .{
- @as(f32, @floatFromInt(region.rect.x)) * layout.w,
- @as(f32, @floatFromInt(region.rect.y)) * layout.h,
- @as(f32, @floatFromInt(region.rect.x + region.rect.w)) * layout.w,
- @as(f32, @floatFromInt(region.rect.y + region.rect.h)) * layout.h,
- };
- const joined = for (out[0..n]) |*other| {
- // The same rows, a gap cell or two apart (a grip, the gap after
- // it, its tag): one band.
- const gap = 2 * layout.w + 0.5;
- if (other[1] == rect[1] and other[3] == rect[3] and rect[0] <= other[2] + gap and other[0] <= rect[2] + gap) {
- other.* = .{ @min(other[0], rect[0]), rect[1], @max(other[2], rect[2]), rect[3] };
- break true;
- }
- } else false;
- if (joined) continue;
- if (n == out.len) {
- const last = &out[n - 1];
- last.* = .{ @min(last[0], rect[0]), @min(last[1], rect[1]), @max(last[2], rect[2]), @max(last[3], rect[3]) };
- continue;
- }
- out[n] = rect;
- n += 1;
- }
- return n;
-}
-
-const CursorBox = Post.Frame.Cursor;
+const CursorBox = struct { x0: f32, y0: f32, x1: f32, y1: f32, rgb: [3]u8, bar: bool };
const max_cursors = 1 + pardes.MAX_PANES + pardes.MAX_TAG_LAYERS;
/// Where the frame draws the focused caret, its top in grid rows: from its
@@ -9996,7 +9832,6 @@ fn caretRide(g: *const Gui, surface: *const pardes.Surface) f32 {
/// is an eighth of its cell wide, a block the whole cell.
fn cursorBoxes(g: *const Gui, surface: *const pardes.Surface, layout: CellLayout, win_h: f32, out: *[max_cursors]CursorBox) usize {
const chrome = &surface.chrome;
- const page = chrome.page orelse bg_default;
var n: usize = 0;
if (surface.cursor) |cursor| {
if (cursor.x < surface.cols and cursor.y < surface.rows and bodyLayerIn(surface.bodyLayers(), cursor.x, cursor.y) == null and tagLayerIn(surface.tagLayers(), cursor.x, cursor.y) == null) {
@@ -10006,7 +9841,7 @@ fn cursorBoxes(g: *const Gui, surface: *const pardes.Surface, layout: CellLayout
const height = std.math.clamp(if (role == .tagline) @as(f32, @floatFromInt(g.tagline_height)) else layout.h, 1.0, layout.h);
const x0 = @as(f32, @floatFromInt(cursor.x)) * layout.w;
const y0 = @as(f32, @floatFromInt(cursor.y)) * layout.h + @as(f32, @floatFromInt(taglineBandOffset(cursor.y, win_h, @intFromFloat(layout.h), @intFromFloat(height))));
- out[n] = .{ .x0 = x0, .y0 = y0, .x1 = x0 + if (cursor.bar) @max(dp(1), width / 8.0) else width, .y1 = y0 + height, .rgb = cursorColor(chrome, cell, role), .text = page, .bar = cursor.bar };
+ out[n] = .{ .x0 = x0, .y0 = y0, .x1 = x0 + if (cursor.bar) @max(dp(1), width / 8.0) else width, .y1 = y0 + height, .rgb = cursorColor(chrome, cell, role), .bar = cursor.bar };
n += 1;
}
}
@@ -10023,7 +9858,7 @@ fn cursorBoxes(g: *const Gui, surface: *const pardes.Surface, layout: CellLayout
const width: f32 = if (role == .tagline) @floatFromInt(g.tagline_width) else layout.w;
const x = left + @as(f32, @floatFromInt(cursor.x)) * width;
const cell = &layer.cells[@as(usize, cursor.y) * layer.cols + cursor.x];
- out[n] = .{ .x0 = x, .y0 = top, .x1 = x + if (cursor.bar) @max(dp(1), width / 8) else width, .y1 = @min(bottom, top + height), .rgb = cursorColor(chrome, cell, role), .text = page, .bar = cursor.bar };
+ out[n] = .{ .x0 = x, .y0 = top, .x1 = x + if (cursor.bar) @max(dp(1), width / 8) else width, .y1 = @min(bottom, top + height), .rgb = cursorColor(chrome, cell, role), .bar = cursor.bar };
n += 1;
}
for (surface.tagLayers()) |*layer| {
@@ -10034,7 +9869,7 @@ fn cursorBoxes(g: *const Gui, surface: *const pardes.Surface, layout: CellLayout
const span = layer.caretSpan(cursor.x, layout.w, width, if (cursor.bar) @max(dp(1), width / 8) else width);
const y = layer.viewport.y + cursor.y;
const top = @as(f32, @floatFromInt(y)) * layout.h + @as(f32, @floatFromInt(taglineBandOffset(y, win_h, g.cell_h, g.tagline_height)));
- out[n] = .{ .x0 = span[0], .y0 = top, .x1 = span[1], .y1 = top + @as(f32, @floatFromInt(g.tagline_height)), .rgb = cursorColor(chrome, &layer.cells[@as(usize, cursor.y) * layer.cols + cursor.x], .tagline), .text = page, .bar = cursor.bar };
+ out[n] = .{ .x0 = span[0], .y0 = top, .x1 = span[1], .y1 = top + @as(f32, @floatFromInt(g.tagline_height)), .rgb = cursorColor(chrome, &layer.cells[@as(usize, cursor.y) * layer.cols + cursor.x], .tagline), .bar = cursor.bar };
n += 1;
}
return n;