Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(cua-driver/linux): glide the agent cursor to the desktop-scope click point (#2061)

Francesco Bonacci7468487d3034
diff --git a/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs b/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
index 22da25cd29..cca9f32f80 100644
--- a/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
+++ b/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
@@ -1047,6 +1047,11 @@ impl Tool for ClickTool {
let sx = args.f64_or("x", 0.0) as i32;
let sy = args.f64_or("y", 0.0) as i32;
let n = args.u64_or("count", 1) as usize;
+ // Glide the agent-cursor overlay to the click point first (the macOS
+ // / Windows desktop paths already do this). Without it the overlay
+ // sits idle elsewhere while only the real pointer warps, so a viewer
+ // sees the cursor "click somewhere else."
+ overlay_glide_to_for(&cursor_id, sx as f64, sy as f64).await;
let r = tokio::task::spawn_blocking(move || {
crate::input::send_click_xtest_desktop(sx, sy, button, n)
})