aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/window.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-04-28 20:21:39 +0000
committerGitHub <noreply@github.com>2019-04-28 20:21:39 +0000
commit9e89aaa477369b20a06f4b9f636d7fd543c4c985 (patch)
tree81deb1b250541a3c8fe7b6f9274f5a87f265a314 /alacritty_terminal/src/window.rs
parent37b66a7cd2e53fae93e3c2c8bc3ddbd9cbe140d2 (diff)
downloadr-alacritty-9e89aaa477369b20a06f4b9f636d7fd543c4c985.tar.gz
r-alacritty-9e89aaa477369b20a06f4b9f636d7fd543c4c985.tar.bz2
r-alacritty-9e89aaa477369b20a06f4b9f636d7fd543c4c985.zip
Switch from copypasta to rust-clipboard
This switches our own `copypasta` crate with the more standardized `clipboard` library, which allows us to get rid of the `xclip` dependency on X11. Additionally, this lays the foundation for native Wayland clipboard support once the clipboard crate is updated (or a fork is created). Fixes #5.
Diffstat (limited to 'alacritty_terminal/src/window.rs')
-rw-r--r--alacritty_terminal/src/window.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/alacritty_terminal/src/window.rs b/alacritty_terminal/src/window.rs
index a929a1b7..5c1457e5 100644
--- a/alacritty_terminal/src/window.rs
+++ b/alacritty_terminal/src/window.rs
@@ -12,12 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::convert::From;
+use std::ffi::c_void;
use std::fmt::Display;
use crate::gl;
use glutin::dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize};
+#[cfg(target_os = "macos")]
+use glutin::os::macos::WindowExt;
#[cfg(not(any(target_os = "macos", windows)))]
-use glutin::os::unix::EventsLoopExt;
+use glutin::os::unix::{EventsLoopExt, WindowExt};
#[cfg(not(target_os = "macos"))]
use glutin::Icon;
use glutin::{
@@ -362,13 +365,11 @@ impl Window {
target_os = "openbsd"
))]
pub fn set_urgent(&self, is_urgent: bool) {
- use glutin::os::unix::WindowExt;
self.window().set_urgent(is_urgent);
}
#[cfg(target_os = "macos")]
pub fn set_urgent(&self, is_urgent: bool) {
- use glutin::os::macos::WindowExt;
self.window().request_user_attention(is_urgent);
}
@@ -381,8 +382,6 @@ impl Window {
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
pub fn get_window_id(&self) -> Option<usize> {
- use glutin::os::unix::WindowExt;
-
match self.window().get_xlib_window() {
Some(xlib_window) => Some(xlib_window as usize),
None => None,
@@ -416,6 +415,11 @@ impl Window {
self.window().set_simple_fullscreen(fullscreen);
}
+ #[cfg(not(any(target_os = "macos", target_os = "windows")))]
+ pub fn get_wayland_display(&self) -> Option<*mut c_void> {
+ self.window().get_wayland_display()
+ }
+
fn window(&self) -> &glutin::Window {
self.windowed_context.window()
}
@@ -441,7 +445,6 @@ impl OsExtensions for Window {}
))]
impl OsExtensions for Window {
fn run_os_extensions(&self) {
- use glutin::os::unix::WindowExt;
use libc::getpid;
use std::ffi::CStr;
use std::ptr;