From 5385853f3ffa6adbd558e741c7e4366ec0b2ff0e Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 18 Sep 2022 10:10:13 +1000 Subject: [PATCH] [client] x11: set _NET_WM_PID Fixes #1013 --- client/displayservers/X11/atoms.h | 1 + client/displayservers/X11/x11.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/client/displayservers/X11/atoms.h b/client/displayservers/X11/atoms.h index c1446bf9..1126e249 100644 --- a/client/displayservers/X11/atoms.h +++ b/client/displayservers/X11/atoms.h @@ -38,6 +38,7 @@ DEF_ATOM(_NET_WM_WINDOW_TYPE, True) \ DEF_ATOM(_NET_WM_WINDOW_TYPE_NORMAL, True) \ DEF_ATOM(_NET_WM_WINDOW_TYPE_UTILITY, True) \ + DEF_ATOM(_NET_WM_PID, True) \ DEF_ATOM(WM_DELETE_WINDOW, True) \ DEF_ATOM(_MOTIF_WM_HINTS, True) \ \ diff --git a/client/displayservers/X11/x11.c b/client/displayservers/X11/x11.c index 40f92c02..f36db977 100644 --- a/client/displayservers/X11/x11.c +++ b/client/displayservers/X11/x11.c @@ -350,6 +350,21 @@ static bool x11Init(const LG_DSInitParams params) // check for Extended Window Manager Hints support x11CheckEWMHSupport(); + if (x11atoms._NET_WM_PID) + { + pid_t pid = getpid(); + XChangeProperty( + x11.display, + x11.window, + x11atoms._NET_WM_PID, + XA_CARDINAL, + 32, + PropModeReplace, + (unsigned char *)&pid, + 1 + ); + } + if (params.borderless) { if (x11atoms._MOTIF_WM_HINTS)