diff --git a/src/x11_init.c b/src/x11_init.c index 1adb08d7..ab96078d 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -410,6 +410,9 @@ static void detectEWMH(void) _glfw.x11.NET_WM_ICON_NAME = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_ICON_NAME"); + _glfw.x11.NET_WM_PID = + getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PID"); + _glfw.x11.NET_WM_PING = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING"); diff --git a/src/x11_platform.h b/src/x11_platform.h index 5f52eb02..ea1b4c7d 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -112,6 +112,7 @@ typedef struct _GLFWlibraryX11 Atom WM_DELETE_WINDOW; Atom NET_WM_NAME; Atom NET_WM_ICON_NAME; + Atom NET_WM_PID; Atom NET_WM_PING; Atom NET_WM_STATE; Atom NET_WM_STATE_FULLSCREEN; diff --git a/src/x11_window.c b/src/x11_window.c index 75719b8f..ea4574dc 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -204,6 +204,16 @@ static GLboolean createWindow(_GLFWwindow* window, } } + if (_glfw.x11.NET_WM_PID != None) + { + const pid_t pid = getpid(); + + XChangeProperty(_glfw.x11.display, window->x11.handle, + _glfw.x11.NET_WM_PID, XA_CARDINAL, 32, + PropModeReplace, + (unsigned char*) &pid, 1); + } + // Set ICCCM WM_HINTS property { XWMHints* hints = XAllocWMHints();