feat: window screenshot (PrintWindow), name-based window resolution
This commit is contained in:
parent
27b1ffc55b
commit
efc9cab2c3
6 changed files with 164 additions and 10 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue