feat: add window management (list, minimize-all, focus, maximize)
This commit is contained in:
parent
c9643c8543
commit
9f06d84f28
7 changed files with 277 additions and 1 deletions
|
|
@ -1,6 +1,14 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
/// Information about a single window on the client machine
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct WindowInfo {
|
||||
pub id: u64,
|
||||
pub title: String,
|
||||
pub visible: bool,
|
||||
}
|
||||
|
||||
/// Messages sent from the relay server to a connected client
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
|
|
@ -31,6 +39,14 @@ pub enum ServerMessage {
|
|||
request_id: Option<Uuid>,
|
||||
message: String,
|
||||
},
|
||||
/// List all visible windows on the client
|
||||
ListWindowsRequest { request_id: Uuid },
|
||||
/// Minimize all windows (like Win+D)
|
||||
MinimizeAllRequest { request_id: Uuid },
|
||||
/// Bring a window to the foreground
|
||||
FocusWindowRequest { request_id: Uuid, window_id: u64 },
|
||||
/// Maximize a window and bring it to the foreground
|
||||
MaximizeAndFocusRequest { request_id: Uuid, window_id: u64 },
|
||||
}
|
||||
|
||||
/// Messages sent from the client to the relay server
|
||||
|
|
@ -53,13 +69,18 @@ pub enum ClientMessage {
|
|||
stderr: String,
|
||||
exit_code: i32,
|
||||
},
|
||||
/// Generic acknowledgement for click/type
|
||||
/// Generic acknowledgement for click/type/minimize-all/focus/maximize
|
||||
Ack { request_id: Uuid },
|
||||
/// Client error response
|
||||
Error {
|
||||
request_id: Uuid,
|
||||
message: String,
|
||||
},
|
||||
/// Response to a list-windows request
|
||||
ListWindowsResponse {
|
||||
request_id: Uuid,
|
||||
windows: Vec<WindowInfo>,
|
||||
},
|
||||
}
|
||||
|
||||
/// Mouse button variants
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue