From 4553935f27bb635bd043434f6c8be03b4939a25d Mon Sep 17 00:00:00 2001 From: "thomas.herzog" Date: Wed, 11 Sep 2019 10:13:48 +0200 Subject: [X11] set PID as window attribute This allows other programs to find out the PID of a Godot instance just by the X11 window ID. --- platform/x11/os_x11.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index dfa0a45538..20502b61d9 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -378,6 +378,13 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5); } + // make PID known to X11 + { + const long pid = this->get_process_id(); + Atom net_wm_pid = XInternAtom(x11_display, "_NET_WM_PID", False); + XChangeProperty(x11_display, x11_window, net_wm_pid, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1); + } + // disable resizable window if (!current_videomode.resizable && !current_videomode.fullscreen) { XSizeHints *xsh; -- cgit v1.2.3