mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 21:32:13 +03:00
window: fix build and clipboard on Windows
This commit is contained in:
parent
478d1f53bc
commit
2b795aa08d
@ -40,6 +40,7 @@ winapi = { version = "0.3", features = [
|
||||
"winerror",
|
||||
"winuser",
|
||||
]}
|
||||
clipboard-win = "2.2"
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
|
||||
filedescriptor = "0.5"
|
||||
|
@ -8,6 +8,7 @@ pub mod x11;
|
||||
pub mod x_and_wayland;
|
||||
pub mod xkeysyms;
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos")))]
|
||||
pub use x_and_wayland::*;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
|
@ -422,6 +422,20 @@ impl WindowOps for Window {
|
||||
func(inner.callbacks.borrow_mut().as_any(), &window, gl_state)
|
||||
})
|
||||
}
|
||||
|
||||
fn get_clipboard(&self) -> Future<String> {
|
||||
Future::result(
|
||||
clipboard_win::get_clipboard_string()
|
||||
.map_err(|e| failure::format_err!("Error getting clipboard: {}", e)),
|
||||
)
|
||||
}
|
||||
|
||||
fn set_clipboard(&self, text: String) -> Future<()> {
|
||||
Future::result(
|
||||
clipboard_win::set_clipboard_string(&text)
|
||||
.map_err(|e| failure::format_err!("Error setting clipboard: {}", e)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Set up bidirectional pointers:
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![cfg(all(unix, not(target_os = "macos")))]
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::VecDeque;
|
||||
use std::time::{Duration, Instant};
|
||||
|
Loading…
Reference in New Issue
Block a user