From c9704a876a197326fc2ed619fbab80ecffc6e4db Mon Sep 17 00:00:00 2001 From: Aaron <12213433+surfine@users.noreply.github.com> Date: Thu, 3 Dec 2026 00:12:34 +0800 Subject: [PATCH] =?UTF-8?q?test(probe):=20=E6=89=8B=E5=8A=BF=E5=BE=80?= =?UTF-8?q?=E5=9B=9E=E6=8B=89=E4=B8=80=E6=AD=A5=E7=AD=89=E7=9B=96=E6=9D=BF?= =?UTF-8?q?=E7=9C=9F=E7=9A=84=E6=92=A4=E6=8E=89=E5=86=8D=E5=88=A4=EF=BC=8C?= =?UTF-8?q?=E6=9C=80=E5=A4=9A=201.5=20=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a690038a 把 calm 从 0.34 改成 0.5 后,往回拉时盖板退回要约 1 秒才收敛撤掉 (实测 0.50→0.10@267ms→0.008@530ms→撤掉@≈1000ms,窗口回到原位)。 探针原来固定只等 700ms,报“盖板留下”;盖板并没有卡住,也不接鼠标。 保留 700ms 看有没有误执行,再轮询 activeCount 到 0,松手后最多 1.5 秒。 Co-Authored-By: Claude Opus 5.5 --- prototype/App/GestureProbe.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prototype/App/GestureProbe.swift b/prototype/App/GestureProbe.swift index 1b49f00c..de30d392 100644 --- a/prototype/App/GestureProbe.swift +++ b/prototype/App/GestureProbe.swift @@ -280,7 +280,13 @@ extension GlanceProbe { self.shoot(cocoaFrame(fromAXPosition: original.origin, size: original.size), "follow-mid") } } + // 盖板用 calm(0.5 s 临界阻尼)退回,收敛到撤掉约 1 s:先照旧等 0.7 s 看有没有误执行, + // 再等盖板真的撤掉,松手后最多 1.5 s;超时才算留下了盖板(下面的 guard 报出来)。 + let coverDeadline = CACurrentMediaTime() + 1.5 try await Task.sleep(for: .milliseconds(700), clock: .suspending) + while effects.activeCount != 0, CACurrentMediaTime() < coverDeadline { + try await Task.sleep(for: .milliseconds(50), clock: .suspending) + } guard owner.shaded[id] == nil, gestures.lastPerformed?.action == performedBefore else { throw EffectError.unavailable("pull-back still acted") }