diff options
| author | Léo Lam <leolino.lam@gmail.com> | 2018-02-03 10:42:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-03 10:42:49 +0100 |
| commit | 2ab29e8284caae295c81b3cf469bd00f42302bd0 (patch) | |
| tree | 71976e88d0ad957c7f16a58533b23972061474dd /Source/Core/DolphinNoGUI/MainNoGUI.cpp | |
| parent | cf5bf3899f65279e142632e5eca4154ab8377545 (diff) | |
| parent | 6182ab6a6aeddf921bc0f62f5758ca8cb9aaf229 (diff) | |
Merge pull request #6311 from cbdevnet/master
Have dolphin-emu-nogui conform to the _NET_WM_PID protocol
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
| -rw-r--r-- | Source/Core/DolphinNoGUI/MainNoGUI.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp index 9582facf2d..db63206e30 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 <X11/Xatom.h> #include <X11/Xlib.h> #include <X11/keysym.h> #include "UICommon/X11Utils.h" +#ifndef HOST_NAME_MAX +#include <climits> +#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<unsigned char*>(&pid), 1); + char host_name[HOST_NAME_MAX] = ""; + if (!gethostname(host_name, sizeof(host_name))) + { + XTextProperty wmClientMachine = {reinterpret_cast<unsigned char*>(host_name), XA_STRING, 8, + strlen(host_name)}; + XSetWMClientMachine(dpy, win, &wmClientMachine); + } XMapRaised(dpy, win); XFlush(dpy); s_window_handle = (void*)win; |
