summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-08-24 10:17:47 +0200
committerKim Woelders <kim@woelders.dk>2021-08-27 08:00:03 +0200
commitc464b8bdcb2c02d7182727a463dd79a7aa6d08d3 (patch)
tree85776bab718f4083ade9a2296b629f48674794a7
parent06458b895354ec6296bee86f01a2380d7268287f (diff)
Set _NET_WM_PID on WM check window
Shown by utilities like wmctrl and xrestop.
-rw-r--r--src/xprop.c4
-rw-r--r--src/xpropdefs.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/xprop.c b/src/xprop.c
index 267f4967..97d5d844 100644
--- a/src/xprop.c
+++ b/src/xprop.c
@@ -25,6 +25,7 @@
25#include <stdio.h> 25#include <stdio.h>
26#include <stdlib.h> 26#include <stdlib.h>
27#include <string.h> 27#include <string.h>
28#include <unistd.h>
28#include <X11/Xatom.h> 29#include <X11/Xatom.h>
29#include <X11/Xlib.h> 30#include <X11/Xlib.h>
30#include <X11/Xutil.h> 31#include <X11/Xutil.h>
@@ -725,9 +726,12 @@ ex_netwm_init(void)
725void 726void
726ex_netwm_wm_identify(EX_Window root, EX_Window check, const char *wm_name) 727ex_netwm_wm_identify(EX_Window root, EX_Window check, const char *wm_name)
727{ 728{
729 unsigned int pid = getpid();
730
728 ex_window_prop_window_set(root, ea_n._NET_SUPPORTING_WM_CHECK, &check, 1); 731 ex_window_prop_window_set(root, ea_n._NET_SUPPORTING_WM_CHECK, &check, 1);
729 ex_window_prop_window_set(check, ea_n._NET_SUPPORTING_WM_CHECK, &check, 1); 732 ex_window_prop_window_set(check, ea_n._NET_SUPPORTING_WM_CHECK, &check, 1);
730 _ex_window_prop_string_utf8_set(check, ea_n._NET_WM_NAME, wm_name); 733 _ex_window_prop_string_utf8_set(check, ea_n._NET_WM_NAME, wm_name);
734 ex_window_prop_card32_set(check, ea_n._NET_WM_PID, &pid, 1);
731} 735}
732 736
733/* 737/*
diff --git a/src/xpropdefs.h b/src/xpropdefs.h
index f24c85d3..d27cceea 100644
--- a/src/xpropdefs.h
+++ b/src/xpropdefs.h
@@ -148,7 +148,7 @@
148 notdef_ATOM_NETWM(_NET_WM_ICON_GEOMETRY) /* Not used */ 148 notdef_ATOM_NETWM(_NET_WM_ICON_GEOMETRY) /* Not used */
149 DEFINE_ATOM_NETWM(_NET_WM_ICON) 149 DEFINE_ATOM_NETWM(_NET_WM_ICON)
150 150
151 notdef_ATOM_NETWM(_NET_WM_PID) /* Not used */ 151 DEFINE_ATOM_NETWM(_NET_WM_PID)
152 152
153 notdef_ATOM_NETWM(_NET_WM_HANDLED_ICONS) /* Not used */ 153 notdef_ATOM_NETWM(_NET_WM_HANDLED_ICONS) /* Not used */
154 154