feat: window screenshot (PrintWindow), name-based window resolution

This commit is contained in:
Helios Agent 2026-03-03 16:39:23 +01:00
parent 27b1ffc55b
commit efc9cab2c3
No known key found for this signature in database
GPG key ID: C8259547CD8309B5
6 changed files with 164 additions and 10 deletions

View file

@ -350,6 +350,20 @@ async fn handle_message(
shell: Arc<Mutex<shell::PersistentShell>>,
) -> ClientMessage {
match msg {
ServerMessage::WindowScreenshotRequest { request_id, window_id } => {
log_cmd!("📷", "screenshot window {}", window_id);
match screenshot::take_window_screenshot(window_id) {
Ok((image_base64, width, height)) => {
log_ok!("Done {} {}×{}", "·".dimmed(), width, height);
ClientMessage::ScreenshotResponse { request_id, image_base64, width, height }
}
Err(e) => {
log_err!("Window screenshot failed: {e}");
ClientMessage::Error { request_id, message: format!("Window screenshot failed: {e}") }
}
}
}
ServerMessage::ScreenshotRequest { request_id } => {
log_cmd!("📷", "screenshot");
match screenshot::take_screenshot() {