summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2019-09-16 17:10:12 +0200
committerChristian Duerr <contact@christianduerr.com>2019-09-16 17:10:12 +0200
commit52fecd71b962c9f65ec2b609fdfc7dbdc2a31064 (patch)
tree42f038a825f399debb7105ae99b17b68efd7b693 /alacritty_terminal
parentc42df413327bdd4d999e43237e915f87fcfa4f92 (diff)
Remove code for setting _NET_WM_PID
This code is no longer necessary since winit now does this for us.
Diffstat (limited to 'alacritty_terminal')
-rw-r--r--alacritty_terminal/src/window.rs60
1 files changed, 0 insertions, 60 deletions
diff --git a/alacritty_terminal/src/window.rs b/alacritty_terminal/src/window.rs
index 47828ac8..b5c56d3c 100644
--- a/alacritty_terminal/src/window.rs
+++ b/alacritty_terminal/src/window.rs
@@ -175,8 +175,6 @@ impl Window {
is_focused: false,
};
- window.run_os_extensions();
-
Ok(window)
}
@@ -411,64 +409,6 @@ impl Window {
}
}
-pub trait OsExtensions {
- fn run_os_extensions(&self) {}
-}
-
-#[cfg(any(target_os = "macos", windows))]
-impl OsExtensions for Window {}
-
-#[cfg(not(any(target_os = "macos", windows)))]
-impl OsExtensions for Window {
- fn run_os_extensions(&self) {
- use libc::getpid;
- use std::ffi::CStr;
- use std::ptr;
- use x11_dl::xlib::{self, PropModeReplace, XA_CARDINAL};
-
- let xlib_display = self.window().get_xlib_display();
- let xlib_window = self.window().get_xlib_window();
-
- if let (Some(xlib_window), Some(xlib_display)) = (xlib_window, xlib_display) {
- let xlib = xlib::Xlib::open().expect("get xlib");
-
- // Set _NET_WM_PID to process pid
- unsafe {
- let _net_wm_pid = CStr::from_ptr(b"_NET_WM_PID\0".as_ptr() as *const _);
- let atom = (xlib.XInternAtom)(xlib_display as *mut _, _net_wm_pid.as_ptr(), 0);
- let pid = getpid();
-
- (xlib.XChangeProperty)(
- xlib_display as _,
- xlib_window as _,
- atom,
- XA_CARDINAL,
- 32,
- PropModeReplace,
- &pid as *const i32 as *const u8,
- 1,
- );
- }
- // Although this call doesn't actually pass any data, it does cause
- // WM_CLIENT_MACHINE to be set. WM_CLIENT_MACHINE MUST be set if _NET_WM_PID is set
- // (which we do above).
- unsafe {
- (xlib.XSetWMProperties)(
- xlib_display as _,
- xlib_window as _,
- ptr::null_mut(),
- ptr::null_mut(),
- ptr::null_mut(),
- 0,
- ptr::null_mut(),
- ptr::null_mut(),
- ptr::null_mut(),
- );
- }
- }
- }
-}
-
impl Proxy {
/// Wakes up the event loop of the window
///