1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-17 02:00:25 +03:00

Fix drag & drop

This commit is contained in:
V 2024-04-08 05:46:14 +02:00 committed by Wez Furlong
parent ba18d0590c
commit 423859cef7
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -2,6 +2,7 @@ use crate::wayland::read_pipe_with_timeout;
use crate::ConnectionOps;
use filedescriptor::{FileDescriptor, Pipe};
use smithay_client_toolkit as toolkit;
use std::os::fd::{AsRawFd, BorrowedFd};
use std::path::PathBuf;
use toolkit::reexports::client::protocol::wl_data_offer::WlDataOffer;
use url::Url;
@ -32,7 +33,9 @@ impl DragAndDrop {
let pipe = Pipe::new()
.map_err(|err| log::error!("Unable to create pipe: {:#}", err))
.ok()?;
offer.receive(URI_MIME_TYPE.to_string(), todo!());
offer.receive(URI_MIME_TYPE.to_string(), unsafe {
BorrowedFd::borrow_raw(pipe.write.as_raw_fd())
});
let read = pipe.read;
offer.finish();
Some(SurfaceAndPipe { window_id, read })