linux/wayland: Add support for pasting images (#17671)

Release Notes:

- You can now paste images into the Assistant Panel to include them as
context on Linux wayland
This commit is contained in:
maan2003 2024-10-01 04:55:32 +05:30 committed by GitHub
parent eb9fd62a90
commit 837756198f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 106 additions and 65 deletions

View file

@ -1799,10 +1799,11 @@ impl Dispatch<wl_data_device::WlDataDevice, ()> for WaylandClientStatePtr {
let fd = pipe.read;
drop(pipe.write);
let read_task = state
.common
.background_executor
.spawn(async { unsafe { read_fd(fd) } });
let read_task = state.common.background_executor.spawn(async {
let buffer = unsafe { read_fd(fd)? };
let text = String::from_utf8(buffer)?;
anyhow::Ok(text)
});
let this = this.clone();
state