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): move macOS windows on another Space with set_window_frame (#4636)

Fred Amartey7808a55e90c6
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/tools/set_window_frame.rs b/libs/cua-driver/rust/crates/platform-macos/src/tools/set_window_frame.rs
index 3373dd3de1..7cbdabcde7 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/tools/set_window_frame.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/tools/set_window_frame.rs
@@ -154,9 +154,9 @@ fn is_self_process_target(pid: u32) -> bool {
fn mutate_and_verify(input: &SetWindowFrameInput) -> Result<FrameOutcome, String> {
use crate::{
ax::bindings::{
- ax_get_window_id, copy_ax_windows, element_screen_rect, is_attribute_settable,
- kAXErrorSuccess, set_point_attr, set_size_attr, AXUIElementCreateApplication,
- AXUIElementSetMessagingTimeout,
+ ax_get_window_id, copy_ax_windows_including, element_screen_rect,
+ is_attribute_settable, kAXErrorSuccess, set_point_attr, set_size_attr,
+ AXUIElementCreateApplication, AXUIElementSetMessagingTimeout,
},
windows::WindowOwner,
};
@@ -205,7 +205,7 @@ fn mutate_and_verify(input: &SetWindowFrameInput) -> Result<FrameOutcome, String
));
}
AXUIElementSetMessagingTimeout(app, 2.0);
- let windows = copy_ax_windows(app);
+ let windows = copy_ax_windows_including(app, pid, window_id);
let target = windows
.iter()
.copied()