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") }