diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 20:17:40 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-04 20:17:40 -0300 |
| commit | a41360e3b9699268d73d598c6eb0155875d3a149 (patch) | |
| tree | ab4a798f198cce4f421af1bd3d6ce9490767a8b6 /build.zig | |
| parent | 99d0bf3669a939fb09ac4ae5a0b2ddbace3d3f63 (diff) | |
| download | pardes-a41360e3b9699268d73d598c6eb0155875d3a149.tar.gz pardes-a41360e3b9699268d73d598c6eb0155875d3a149.zip | |
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.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -1076,12 +1076,36 @@ pub fn build(b: *std.Build) void { \\#define SDL_DISABLE_OLD_NAMES 1 \\#include <SDL3/SDL.h> \\#include "font.h" + \\#include "macos_trackpad.h" \\ ); const gui_c = b.addTranslateC(.{ .root_source_file = header, .target = target, .optimize = optimize }); gui_c.addIncludePath(dep.path("include")); gui_c.addIncludePath(b.path("src/gui")); gm.addImport("gui_c", gui_c.createModule()); + if (target.result.os.tag == .macos) { + const arch = if (target.result.cpu.arch == .aarch64) "arm64" else @tagName(target.result.cpu.arch); + const shim = b.addSystemCommand(&.{ "xcrun", "clang", "-fobjc-arc", "-O2", "-target", b.fmt("{s}-apple-macos13.0", .{arch}), "-I" }); + shim.addDirectoryArg(dep.path("include")); + shim.addArg("-c"); + shim.addFileArg(b.path("src/gui/macos_trackpad.m")); + // Header changes invalidate the independently compiled adapter. + shim.addFileInput(b.path("src/gui/macos_trackpad.h")); + shim.addArg("-o"); + gm.addObjectFile(shim.addOutputFileArg("macos_trackpad.o")); + gm.linkFramework("Cocoa", .{}); + const adapter_test = b.addSystemCommand(&.{ "xcrun", "clang", "-fobjc-arc", "-O1", "-framework", "Cocoa", "-I" }); + adapter_test.addDirectoryArg(dep.path("include")); + adapter_test.addFileArg(b.path("test/macos_trackpad.m")); + adapter_test.addFileInput(b.path("src/gui/macos_trackpad.m")); + adapter_test.addFileInput(b.path("src/gui/macos_trackpad.h")); + adapter_test.addArg("-o"); + const adapter_bin = adapter_test.addOutputFileArg("macos-trackpad-test"); + const run_adapter = std.Build.Step.Run.create(b, "run macos-trackpad-test"); + run_adapter.addFileArg(adapter_bin); + run_adapter.has_side_effects = true; + b.step("macos-trackpad-test", "test native SDL trackpad decoding and haptics without hardware").dependOn(&run_adapter.step); + } } gm.linkLibrary(freetype.?); // HarfBuzz from source, like FreeType: its FreeType integration |
