macOS: drag tool executes without error but performs no actual drag (window move / text selection)
Bug: macOS drag tool executes without error but performs no actual drag (window move / text selection)
Environment:
- macOS 15.7.7 (arm64)
open-computer-use0.3.1 (npm, native darwin-arm64 runtime)- Permissions granted: Accessibility + Screen Recording (confirmed via
ocu doctor) - Display: 4K 3840×2160 at 2x Retina (logical 1920×1080)
Steps to reproduce:
-
Window drag — move Calculator:
ocu call drag --args '{"app":"com.apple.calculator","from_x":1076,"from_y":1090,"to_x":976,"to_y":1090}'The call returns success (
isError: false+ screenshot payload), but the window position does not change (verified via AppleScriptposition of windowbefore/after). Tried both 1x (logical points) and 2x (pixel) coordinates. -
Text selection drag — TextEdit:
- Open a new TextEdit document, type "hello world drag test 12345"
- Drag across the text line (from text start to the right)
- Press Cmd+C →
pbpastereturns empty (no text was selected)
Expected: drag should move windows / select text like a real mouse drag.
Actual: the MCP tool posts the mouse events without error, but macOS does not register them as a real drag gesture. Neither window dragging (window server) nor in-app text selection recognizes the synthetic drag.
Notes:
click,press_key,set_value,scroll,list_apps,get_app_stateall work correctly on this machine — onlydragis affected.- Same behavior via the MCP server and via
ocu call dragCLI directly. - Happy to provide screenshots or run any additional diagnostics on request.
Additional data point: I also tested the Qwen fork (@qwen-code/open-computer-use 0.2.3) on the same machine — same behavior: the drag call executes successfully (isError: false) but the window does not move (verified via AppleScript position before/after). Both runtimes share the same drag implementation, so this appears to be a systemic limitation of the synthetic drag on macOS rather than a regression in 0.3.1.
Note: when running the Qwen fork via npx, its runtime reported accessibility=missing (different TCC responsible-process attribution), but running its native binary directly (child of the terminal that has Accessibility granted) resolves that. The drag behavior is identical either way.
Yess
I hit the same issue, spent a bit working through it with Claude, and I am proposing the fix below to improve drag-and-drop on macOS. It is working on my local macOS 26.6.2, and I have not tested it on Windows or Linux at this time.
The behavior isn't really a bug. It's a deliberate default with an opt-in, but nothing in the tool surface tells you that. The drag method picks one of two code paths based on an environment variable, and the logic is in performDragEvent in packages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swift.
By default it calls InputSimulation.dragTargeted, which posts the mouse move, down, dragged, and up events with CGEvent.postToPid. Those go straight to the target process and will never reach the Window Server. This causes the real pointer to never move, but a Window Server drag session never starts either, and the associated window moves, text selection, and Finder drag-and-drop all need that session. Every event posts fine, so the tool reports success but nothing happens.
The other path is InputSimulation.dragGlobally. You configure it by setting OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS=1 in the server process environment. It uses .cghidEventTap and actually drives the drag, but it moves the real pointer and can steal foreground focus.
The default was updated last on 2026-04-22 (docs/histories/2026-04/20260422-1113-align-remaining-tool-defaults.md) so click, scroll, and drag would never move your real mouse. The gate is documented in docs/ARCHITECTURE.md and docs/SECURITY.md, but only in Chinese. And neither the drag description nor its result ever mentioned it, unlike click, whose click_method schema already names the variable.
Workaround without the fix:
"open-computer-use": {
"command": "open-computer-use",
"args": ["mcp"],
"env": { "OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS": "1" }
}
Restart the server entry after. The CLI forwards every OPEN_COMPUTER_USE_* variable to the App Agent on each request, so setting it on the server entry is enough. Keep it scoped to the work that needs a drag, since the real cursor moves while it's on.
The fix in https://github.com/iFurySt/open-codex-computer-use/pull/63 leaves the default alone and just makes the behavior legible. The drag description now spells out the limitation and names the variable, and every drag result carries a Drag delivered via app_post or Drag delivered via global pointer path line, so a no-op is visible instead of looking like success.
Following up on my comment above — I need to correct one line, and report what actually fixes this.
Correction first: I wrote "it is working on my local macOS 26.6.2." That referred to the legibility change only, and it overstated things — at that point drag-and-drop itself still did not work, on either path.
It does now. The gate was only half the story. The synthetic drag posted leftMouseDragged events with an absolute position but no movement delta, so macOS read every step as "button held, no motion" and never opened a window-server drag session. Every event posted fine, the call returned success, nothing dragged.
What makes a synthetic drag register on current macOS:
- set
kCGMouseEventDeltaX/kCGMouseEventDeltaY(both the integer and double fields) to the per-step movement on eachleftMouseDraggedevent — macOS reads the delta, not the absolute position, to decide the pointer moved - post from a nil (default) event source to the HID tap, and do not override the event timestamp
- interpolate the motion over multiple steps, with a short pause after mouse-down to clear the drag threshold
- on macOS 26+, tag the down/dragged/up sequence with one event number seeded above the system's last (
CGEventSource.counterForEventType); older macOS ignores it
Validated on macOS 26.6.2 with the global-pointer gate enabled: TextEdit text selection selects the line, a file drops into a folder in Finder, and a window moves by its title bar. The default postToPid path still cannot drive a real drag (the window server does not route it), so that path stays a no-op and the environment gate remains what turns on a working drag.
The fix is in the updated PR: https://github.com/iFurySt/open-codex-computer-use/pull/63
This was fixed by #63, merged as 5c76992 (2026-09-09), and is included in v1.0.0 and later (current latest is v1.1.2).
The behavior has two parts:
- The default
dragpath posts events withCGEvent.postToPid. That path intentionally does not move the real pointer, and it cannot drive window-server drag sessions (window moves, text selection, Finder drag-and-drop). The result now saysDrag delivered via app_postand explains why nothing moved, instead of looking like a success. - To drive a real drag, set
OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS=1in the server process environment. The global path posts to the HID tap, writes the per-step mouse deltas, and on macOS 26+ shares one gesture event number across down/dragged/up. Enabling it may move the real pointer and change foreground focus, so it remains opt-in.
I did not re-run a physical-pointer drag in this environment, so I cannot confirm it on your machine. Could you retest with v1.1.2 and the environment variable above? If drag works for window moving and text selection, feel free to close this issue; if it still fails, please share the Drag delivered via ... line from the result.
I rechecked this on current main (43eb4b5, v1.1.2) on macOS 27.2 with a debug build and a TextEdit document:
- Default
drag(app_post): I dragged the title bar from (328, 14) to (448, 94) in window points, and in a separate run dragged across the first text line. The window didn't move and nothing was selected. Each result includedDrag delivered via app_post: ... This path cannot drive window-server drag sessions such as window moves, text selection, or Finder drag-and-drop ..., so the no-op no longer looks like a success. That part of the report is fixed by #63 (5c76992, shipped in 0.3.5 and later). - The default staying a no-op is intentional. Those events are posted to the process and never pass through the window server.
- The opt-in path (
OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS=1) moves the real pointer. I couldn't get a clean run of it on this machine because the pointer was in use, so I can't add a confirmation to the one above. A retest on v1.1.2 with that variable set is still the deciding check. If window moves and text selection work there, this can be closed.
Closing as fixed by #63, which shipped in v1.0.0 and later.
The default drag posts its events to the app's process, so your real pointer never moves. For the same reason it can't start a window-server drag: window moves, text selection and Finder drag-and-drop. Since #63 the result says so (Drag delivered via app_post: ...) instead of looking like a success.
For a real drag, set OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS=1 in the MCP server's environment. That path moves the real pointer, and it was confirmed on macOS 26.6.2 earlier in this thread. If it still fails with the variable set, please reopen with the Drag delivered via ... line from the result.