fix x11 missing pid

This commit is contained in:
tims 2024-12-22 12:13:20 +05:30
parent b51a28b75f
commit feee6f62f0

View file

@ -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);