aboutsummaryrefslogtreecommitdiff
path: root/src/window.rs
diff options
context:
space:
mode:
authorns <portification@gmail.com>2017-05-28 05:08:28 +0200
committerJoe Wilm <jwilm@users.noreply.github.com>2017-05-27 20:08:28 -0700
commitb9ec141c927b333bfea5d8a285deedd164181dd8 (patch)
tree4e585aee9265f8da68d039ab33d396882455be3d /src/window.rs
parent0e4edc5420ee7e1d240980686ff0244d2627993d (diff)
downloadalacritty-b9ec141c927b333bfea5d8a285deedd164181dd8.tar.gz
alacritty-b9ec141c927b333bfea5d8a285deedd164181dd8.zip
Find and set $WINDOWID to X11 window ID (#586)
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/window.rs b/src/window.rs
index 00f60c38..d0a51e6b 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -303,6 +303,21 @@ impl Window {
else { glutin::CursorState::Hide }).unwrap();
}
}
+
+ #[cfg(not(target_os = "macos"))]
+ pub fn get_window_id(&self) -> Option<usize> {
+ use glutin::os::unix::WindowExt;
+
+ match self.glutin_window.get_xlib_window() {
+ Some(xlib_window) => Some(xlib_window as usize),
+ None => None
+ }
+ }
+
+ #[cfg(target_os = "macos")]
+ pub fn get_window_id(&self) -> Option<usize> {
+ None
+ }
}
pub trait OsExtensions {