diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-27 22:18:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-27 22:18:32 -0300 |
| commit | 3899f66a8c81d85dfb8f9ad18481bfff110c5d99 (patch) | |
| tree | ab637a2af0f27f24f998d91871ef278702e09965 | |
| parent | f65aaf7c569f3238b15e6e7bb0d3c28ffb244c69 (diff) | |
| download | pardes-3899f66a8c81d85dfb8f9ad18481bfff110c5d99.tar.gz pardes-3899f66a8c81d85dfb8f9ad18481bfff110c5d99.zip | |
Give the core the host monotonic time in the AppKit pump and animation callback so a Space prefix starts its hint delay and redraws when it expires. Keep scroll and rotation momentum on their existing frame timer.
Verified that the native Space-only regression fails before this fix and passes afterward.
| -rw-r--r-- | runtime/macos.zig | 8 | ||||
| -rw-r--r-- | test/macos-snapshots/leader-hints.golden | 0 | ||||
| -rw-r--r-- | test/macos-snapshots/leader-hints.snap | 8 | ||||
| -rw-r--r-- | test/macos_e2e.swift | 1 |
4 files changed, 12 insertions, 5 deletions
diff --git a/runtime/macos.zig b/runtime/macos.zig index efb2ddbc..1b0ecd83 100644 --- a/runtime/macos.zig +++ b/runtime/macos.zig @@ -843,6 +843,7 @@ export fn pardes_tick() bool { did = did or drained.count != 0; if (drained.pending) wake(st); } + st.core.advance(@intCast(std.Io.Clock.awake.now(st.io).nanoseconds)); while (st.core.nextEffect()) |effect| { did = true; st.core.perform(effect); @@ -908,17 +909,14 @@ export fn pardes_animation_tick() bool { const st = &(state orelse return false); const now: u64 = @intCast(std.Io.Clock.awake.now(st.io).nanoseconds); + st.core.advance(now); const spend = spendTickTime(st.last_tick_ns, now, st.tick_bank_ns); st.last_tick_ns = now; st.tick_bank_ns = spend.bank_ns; - var changed = false; + var changed = st.core.needs_frame; for (0..spend.steps) |_| { - if (st.core.animationActive()) { - st.core.update(.tick); - changed = true; - } if (st.scroll_coasting) { const spent_now = spendScroll( st, diff --git a/test/macos-snapshots/leader-hints.golden b/test/macos-snapshots/leader-hints.golden new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/macos-snapshots/leader-hints.golden diff --git a/test/macos-snapshots/leader-hints.snap b/test/macos-snapshots/leader-hints.snap new file mode 100644 index 00000000..eaf186a7 --- /dev/null +++ b/test/macos-snapshots/leader-hints.snap @@ -0,0 +1,8 @@ +start 28 110 +native-metrics +open-fixture context.zig +wait 3000 ) u32 +key space +wait 2000 b buffer +capture leader-hints +key esc diff --git a/test/macos_e2e.swift b/test/macos_e2e.swift index 4438e942..a4998d39 100644 --- a/test/macos_e2e.swift +++ b/test/macos_e2e.swift @@ -1187,6 +1187,7 @@ private final class Driver: PardesViewDelegate { /// `pgup`/`pageup`) so a script reads the same in either suite. private func keyStroke(_ name: String) throws -> (cp: UInt32, mods: UInt32) { switch name { + case "space": return (32, 0) case "enter", "ret": return (UInt32(PARDES_KEY_ENTER), 0) case "escape", "esc": return (UInt32(PARDES_KEY_ESCAPE), 0) case "tab": return (UInt32(PARDES_KEY_TAB), 0) |
