first pass of merging in warp (doesn't build)
This commit is contained in:
@@ -11,14 +11,13 @@ mod screenshot;
|
||||
mod session;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use galaxyui::r#async::Timer;
|
||||
use pathfinder_geometry::vector::Vector2I;
|
||||
|
||||
use crate::{Action, ActionResult, Options};
|
||||
|
||||
use keyboard::Keyboard;
|
||||
use mouse::Mouse;
|
||||
use pathfinder_geometry::vector::Vector2I;
|
||||
use session::PortalSession;
|
||||
use galaxyui_core::r#async::Timer;
|
||||
|
||||
use crate::{Action, ActionResult, Options, TargetedAction};
|
||||
|
||||
/// An actor that performs computer use actions on Wayland via XDG portals.
|
||||
pub struct Actor {
|
||||
@@ -58,7 +57,7 @@ impl crate::Actor for Actor {
|
||||
|
||||
async fn perform_actions(
|
||||
&mut self,
|
||||
actions: &[Action],
|
||||
actions: &[TargetedAction],
|
||||
options: Options,
|
||||
) -> Result<ActionResult, String> {
|
||||
// Ensure we have an active session before processing actions.
|
||||
@@ -67,7 +66,10 @@ impl crate::Actor for Actor {
|
||||
|
||||
let mut last_mouse_position: Option<Vector2I> = None;
|
||||
|
||||
for action in actions {
|
||||
for targeted in actions {
|
||||
// Per-window targeting is not supported on Wayland; act on the screen / focused
|
||||
// surface regardless of the requested target.
|
||||
let action: &Action = &targeted.action;
|
||||
// Re-acquire session reference each iteration (borrow checker workaround).
|
||||
let session = self
|
||||
.session
|
||||
@@ -153,9 +155,6 @@ impl crate::Actor for Actor {
|
||||
self.mouse.last_position()
|
||||
};
|
||||
|
||||
Ok(ActionResult {
|
||||
screenshot,
|
||||
cursor_position,
|
||||
})
|
||||
Ok(ActionResult::legacy(screenshot, cursor_position))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user