From feee6f62f0c25826b9e91fe6bb09340ded4f4550 Mon Sep 17 00:00:00 2001 From: tims <0xtimsb@gmail.com> Date: Sun, 22 Dec 2024 12:13:20 +0530 Subject: [PATCH] fix x11 missing pid --- crates/gpui/src/platform/linux/x11/window.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/gpui/src/platform/linux/x11/window.rs b/crates/gpui/src/platform/linux/x11/window.rs index ed6467a5e1..40eab6a343 100644 --- a/crates/gpui/src/platform/linux/x11/window.rs +++ b/crates/gpui/src/platform/linux/x11/window.rs @@ -55,6 +55,7 @@ x11rb::atom_manager! { WM_PROTOCOLS, WM_DELETE_WINDOW, WM_CHANGE_STATE, + _NET_WM_PID, _NET_WM_NAME, _NET_WM_STATE, _NET_WM_STATE_MAXIMIZED_VERT, @@ -436,6 +437,18 @@ impl X11WindowState { // Collect errors during setup, so that window can be destroyed on failure. let setup_result = maybe!({ + let pid = std::process::id(); + check_reply( + || "X11 ChangeProperty for _NET_WM_PID failed.", + xcb.change_property32( + xproto::PropMode::REPLACE, + x_window, + atoms._NET_WM_PID, + xproto::AtomEnum::CARDINAL, + &[pid], + ), + )?; + if let Some(size) = params.window_min_size { let mut size_hints = WmSizeHints::new(); let min_size = (size.width.0 as i32, size.height.0 as i32);