From 6182ab6a6aeddf921bc0f62f5758ca8cb9aaf229 Mon Sep 17 00:00:00 2001 From: cbdev Date: Fri, 19 Jan 2018 22:31:44 +0100 Subject: [PATCH] dolphin-emu-nogui: Conform to the _NET_WM_PID protocol --- Source/Core/DolphinNoGUI/MainNoGUI.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp index 9582facf2d8e..db63206e302b 100644 --- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp +++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp @@ -141,9 +141,14 @@ void Host_UpdateProgressDialog(const char* caption, int position, int total) } #if HAVE_X11 +#include #include #include #include "UICommon/X11Utils.h" +#ifndef HOST_NAME_MAX +#include +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif class PlatformX11 : public Platform { @@ -172,6 +177,16 @@ class PlatformX11 : public Platform Atom wmProtocols[1]; wmProtocols[0] = XInternAtom(dpy, "WM_DELETE_WINDOW", True); XSetWMProtocols(dpy, win, wmProtocols, 1); + pid_t pid = getpid(); + XChangeProperty(dpy, win, XInternAtom(dpy, "_NET_WM_PID", False), XA_CARDINAL, 32, + PropModeReplace, reinterpret_cast(&pid), 1); + char host_name[HOST_NAME_MAX] = ""; + if (!gethostname(host_name, sizeof(host_name))) + { + XTextProperty wmClientMachine = {reinterpret_cast(host_name), XA_STRING, 8, + strlen(host_name)}; + XSetWMClientMachine(dpy, win, &wmClientMachine); + } XMapRaised(dpy, win); XFlush(dpy); s_window_handle = (void*)win;