mirror of
https://github.com/libretro/RetroArch
synced 2025-03-26 02:37:23 +00:00
Set _NET_WM_PID
Also set WM_CLIENT_MACHINE since https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html says you must do so if setting the first.
This commit is contained in:
parent
096686140d
commit
18b2bd527c
@ -21,6 +21,8 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@ -155,9 +157,27 @@ static void x11_set_window_class(Display *dpy, Window win)
|
|||||||
XSetClassHint(dpy, win, &hint);
|
XSetClassHint(dpy, win, &hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void x11_set_window_pid(Display *dpy, Window win)
|
||||||
|
{
|
||||||
|
pid_t pid = getpid();
|
||||||
|
char hostname[HOST_NAME_MAX + 1];
|
||||||
|
|
||||||
|
XChangeProperty(dpy, win, XInternAtom(dpy, "_NET_WM_PID", False),
|
||||||
|
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1);
|
||||||
|
|
||||||
|
if(gethostname(hostname, HOST_NAME_MAX + 1) == -1)
|
||||||
|
RARCH_WARN("Failed to get hostname.\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XChangeProperty(dpy, win, XA_WM_CLIENT_MACHINE, XA_STRING, 8,
|
||||||
|
PropModeReplace, (unsigned char *)hostname, strlen(hostname));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void x11_set_window_attr(Display *dpy, Window win)
|
void x11_set_window_attr(Display *dpy, Window win)
|
||||||
{
|
{
|
||||||
x11_set_window_class(dpy, win);
|
x11_set_window_class(dpy, win);
|
||||||
|
x11_set_window_pid(dpy, win);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xdg_screensaver_inhibit(Window wnd)
|
static void xdg_screensaver_inhibit(Window wnd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user