File tree Expand file tree Collapse file tree
apps/macos/Sources/OpenClaw Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,9 +111,18 @@ final class ComputerActionService {
111111 let releaseGenerationAtStart = self . releaseGeneration
112112 let display = try await self . resolveDisplay ( screenIndex : params . screenIndex )
113113 try await self . dispatch ( params , display : display )
114- // No suspension between dispatch arming the button and this check, so the
115- // read of leftButtonDown/releaseGeneration is atomic on the actor.
116- if self . leftButtonDown , self . releaseGeneration != releaseGenerationAtStart {
114+ // Catch-up release scoped to the left_mouse_down that armed the button:
115+ // that branch is synchronous with no await before the check, so
116+ // leftButtonDown here reflects THIS action's own arm, not a concurrent
117+ // invoke's. Restricting to leftMouseDown keeps a stale non-arming invoke
118+ // (scroll/type/move) that predates a lifecycle release from releasing a
119+ // button a newer action legitimately holds. If the generation moved while
120+ // this action was suspended, a lifecycle release ran before it armed, so
121+ // the release must win and the just-armed button is released.
122+ if params . action == . leftMouseDown ,
123+ self . leftButtonDown ,
124+ self . releaseGeneration != releaseGenerationAtStart
125+ {
117126 self . releaseHeldInput ( )
118127 }
119128 let cursor = self . automation . currentMouseLocation ( ) ?? CGPoint . zero
You can’t perform that action at this time.
0 commit comments