Images!
This commit is contained in:
@@ -294,11 +294,11 @@ impl WaylandWindow {
|
||||
let seat: wl_seat::WlSeat = globals.bind(&qh, 1..=9, ())?;
|
||||
let wm_base: xdg_wm_base::XdgWmBase = globals.bind(&qh, 1..=6, ())?;
|
||||
let clipboard_manager = globals.bind(&qh, 1..=3, ()).ok();
|
||||
let clipboard_device = clipboard_manager
|
||||
.as_ref()
|
||||
.map(|manager: &wl_data_device_manager::WlDataDeviceManager| {
|
||||
let clipboard_device = clipboard_manager.as_ref().map(
|
||||
|manager: &wl_data_device_manager::WlDataDeviceManager| {
|
||||
manager.get_data_device(&seat, &qh, ())
|
||||
});
|
||||
},
|
||||
);
|
||||
let cursor_shape_manager = globals.bind(&qh, 1..=2, ()).ok();
|
||||
let primary_selection_manager = globals.bind(&qh, 1..=1, ()).ok();
|
||||
let primary_selection_device = primary_selection_manager.as_ref().map(
|
||||
@@ -619,7 +619,8 @@ impl WaylandWindow {
|
||||
}
|
||||
|
||||
pub fn read_primary_selection_text(&mut self) -> Result<Option<String>, Box<dyn Error>> {
|
||||
let preferred_mime = preferred_plain_text_mime(&self.state.primary_selection_offer_mime_types);
|
||||
let preferred_mime =
|
||||
preferred_plain_text_mime(&self.state.primary_selection_offer_mime_types);
|
||||
let Some(mime_type) = preferred_mime else {
|
||||
return Ok(self.state.primary_selection_text.clone());
|
||||
};
|
||||
@@ -1097,10 +1098,11 @@ fn spawn_window_worker(
|
||||
let mut state_ref = state.borrow_mut();
|
||||
match state_ref.window.read_clipboard_text() {
|
||||
Ok(Some(text)) => {
|
||||
let _ = state_ref.event_tx.send(PlatformEvent::ClipboardText {
|
||||
window_id: state_ref.window_id,
|
||||
text,
|
||||
});
|
||||
let _ =
|
||||
state_ref.event_tx.send(PlatformEvent::ClipboardText {
|
||||
window_id: state_ref.window_id,
|
||||
text,
|
||||
});
|
||||
}
|
||||
Ok(None) => {}
|
||||
Err(error) => {
|
||||
|
||||
Reference in New Issue
Block a user