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:
parent
eb9fd62a90
commit
837756198f
3 changed files with 106 additions and 65 deletions
|
@ -603,17 +603,11 @@ pub(super) fn get_xkb_compose_state(cx: &xkb::Context) -> Option<xkb::compose::S
|
|||
state
|
||||
}
|
||||
|
||||
pub(super) unsafe fn read_fd(mut fd: FileDescriptor) -> Result<String> {
|
||||
pub(super) unsafe fn read_fd(mut fd: FileDescriptor) -> Result<Vec<u8>> {
|
||||
let mut file = File::from_raw_fd(fd.as_raw_fd());
|
||||
|
||||
let mut buffer = String::new();
|
||||
file.read_to_string(&mut buffer)?;
|
||||
|
||||
// Normalize the text to unix line endings, otherwise
|
||||
// copying from eg: firefox inserts a lot of blank
|
||||
// lines, and that is super annoying.
|
||||
let result = buffer.replace("\r\n", "\n");
|
||||
Ok(result)
|
||||
let mut buffer = Vec::new();
|
||||
file.read_to_end(&mut buffer)?;
|
||||
Ok(buffer)
|
||||
}
|
||||
|
||||
impl CursorStyle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue