diff options
Diffstat (limited to 'alacritty/src/clipboard.rs')
-rw-r--r-- | alacritty/src/clipboard.rs | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/alacritty/src/clipboard.rs b/alacritty/src/clipboard.rs index dd0a8348..35982cf5 100644 --- a/alacritty/src/clipboard.rs +++ b/alacritty/src/clipboard.rs @@ -1,7 +1,5 @@ -#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] -use std::ffi::c_void; - use log::{debug, warn}; +use winit::window::raw_window_handle::RawDisplayHandle; use alacritty_terminal::term::ClipboardType; @@ -21,20 +19,15 @@ pub struct Clipboard { } impl Clipboard { - #[cfg(any(not(feature = "wayland"), target_os = "macos", windows))] - pub fn new() -> Self { - Self::default() - } - - #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] - pub unsafe fn new(display: Option<*mut c_void>) -> Self { + pub unsafe fn new(display: RawDisplayHandle) -> Self { match display { - Some(display) => { + #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] + RawDisplayHandle::Wayland(display) => { let (selection, clipboard) = - wayland_clipboard::create_clipboards_from_external(display); + wayland_clipboard::create_clipboards_from_external(display.display); Self { clipboard: Box::new(clipboard), selection: Some(Box::new(selection)) } }, - None => Self::default(), + _ => Self::default(), } } |