a73x

c1104500

Final polish: restore SIGUSR1 under visibility gate, drop unused import

a73x   2026-04-16 19:05

Commit message
Final polish: restore SIGUSR1 under visibility gate, drop unused import

- SIGUSR1 stats dump moved above the render gate in runTerminal so it
  fires even while the surface is hidden (regression from the gate
  migration).
- Remove unused `const wl` import from src/frame_loop.zig; the module
  doesn't reference wl directly — adapter casts happen in wayland.zig.

src/frame_loop.zig
Old New
@@ -1,5 +1,4 @@
1 const std = @import("std"); 1 const std = @import("std");
2 const wl = @import("wayland").client.wl;
3 const scale_tracker = @import("scale_tracker"); 2 const scale_tracker = @import("scale_tracker");
4 3
5 // Mirror of wayland.SurfaceState. Using a structural duplicate here instead of 4 // Mirror of wayland.SurfaceState. Using a structural duplicate here instead of
src/main.zig
Old New
@@ -342,6 +342,13 @@ fn runTerminal(alloc: std.mem.Allocator) !void {
342 render_pending = true; 342 render_pending = true;
343 } 343 }
344 344
345 // Stats dump is valid regardless of visibility — fires even while
346 // the surface is hidden, so an operator can SIGUSR1 a stuck-seeming
347 // waystty and get a response.
348 if (sigusr1_received.swap(false, .acq_rel)) {
349 printFrameStats(computeFrameStats(&frame_ring));
350 }
351
345 if (!shouldRenderFrame(render_pending, false, false)) continue; 352 if (!shouldRenderFrame(render_pending, false, false)) continue;
346 if (!bench_unthrottled and !frame_loop.canRender()) continue; // hidden — no Vulkan at all 353 if (!bench_unthrottled and !frame_loop.canRender()) continue; // hidden — no Vulkan at all
347 354
@@ -617,11 +624,6 @@ fn runTerminal(alloc: std.mem.Allocator) !void {
617 624
618 frame_ring.push(frame_timing); 625 frame_ring.push(frame_timing);
619 626
620 // Check for SIGUSR1 stats dump request
621 if (sigusr1_received.swap(false, .acq_rel)) {
622 printFrameStats(computeFrameStats(&frame_ring));
623 }
624
625 clearConsumedDirtyFlags(&term.render_state.dirty, dirty_rows, refresh_plan); 627 clearConsumedDirtyFlags(&term.render_state.dirty, dirty_rows, refresh_plan);
626 if (!bench_unthrottled) try frame_loop.commitRender(); 628 if (!bench_unthrottled) try frame_loop.commitRender();
627 render_pending = false; 629 render_pending = false;