From a41360e3b9699268d73d598c6eb0155875d3a149 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 20:17:40 -0300 Subject: Improve macOS detached client gestures and rendering Add a thin AppKit input adapter for SDL trackpad momentum, multi-finger and force clicks, deliberate pinch zoom, rotation haptics, and shorter history swipes with early haptic cues. Keep remote cursor motion on the frontend clock, resolve configured fonts locally, follow terminal directories without an authority window, and render live tagline themes without waiting for daemon ticks. Validate with native GUI and TUI release builds, trackpad policy and adapter tests, targeted scroll and replica theme regressions, live remote digest checks, visual theme switching, and user trackpad testing. --- src/fonts.zig | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/fonts.zig') diff --git a/src/fonts.zig b/src/fonts.zig index 88cde63a..d50227cd 100644 --- a/src/fonts.zig +++ b/src/fonts.zig @@ -81,6 +81,34 @@ pub fn list(arena: std.mem.Allocator, want_name: ?[]const u8) []const Font { return scan(arena, null, true); } +/// A remote config's absolute font path belongs to its machine. Resolve the +/// same face by name on this machine, retaining the filename as a fallback. +pub fn remote(arena: std.mem.Allocator, path: []const u8, name: []const u8) ?Font { + if (name.len > 0) { + const matches = list(arena, name); + if (matches.len > 0) return matches[0]; + } + const base = std.fs.path.basename(path); + const stem = base[0 .. base.len - std.fs.path.extension(base).len]; + if (stem.len == 0 or std.mem.eql(u8, stem, name)) return null; + const matches = list(arena, stem); + return if (matches.len > 0) matches[0] else null; +} + +test "a remote font config resolves the installed face despite another machine's path" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const alloc = arena.allocator(); + const installed = list(alloc, null); + if (installed.len == 0) return error.SkipZigTest; + const face = installed[0]; + const foreign = try std.fmt.allocPrint(alloc, "/other-machine/fonts/{s}", .{std.fs.path.basename(face.path)}); + const by_name = remote(alloc, foreign, face.name) orelse return error.MissingLocalFace; + try std.testing.expectEqualStrings(face.path, by_name.path); + const by_file = remote(alloc, foreign, "") orelse return error.MissingLocalFace; + try std.testing.expectEqualStrings(face.path, by_file.path); +} + /// Installed members of `fallback_names`, returned in preference order. This /// is runtime discovery only: no local font path or exploration result enters /// the build, and a machine with none simply uses embedded Adwaita Mono. -- cgit v1.3