summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKlee Dienes <klee.dienes@hadronindustries.com>2014-08-29 11:36:26 -0400
committerKlee Dienes <klee.dienes@hadronindustries.com>2016-08-27 18:00:28 -0400
commit3c7151f756ed36cca6e8d2723dfa1633984d2eea (patch)
treea5c53295e03e37abc0b39c91b8031888e67ccd96 /src
parentfd898918df37440fd1c560b8c45aa46523f856b8 (diff)
Add support for _NET_WM_PID
Diffstat (limited to 'src')
-rw-r--r--src/winwidget.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index f249694..71d0b14 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -311,15 +311,21 @@ void winwidget_create_window(winwidget ret, int w, int h)
void winwidget_update_title(winwidget ret)
{
char *name;
+ pid_t pid;
Atom prop_name = XInternAtom(disp, "_NET_WM_NAME", False);
+ Atom prop_pid = XInternAtom(disp, "_NET_WM_PID", False);
Atom prop_icon = XInternAtom(disp, "_NET_WM_ICON_NAME", False);
Atom prop_utf8 = XInternAtom(disp, "UTF8_STRING", False);
D(("winwid->name = %s\n", ret->name));
name = ret->name ? ret->name : "feh";
+ pid = getpid();
XStoreName(disp, ret->win, name);
XSetIconName(disp, ret->win, name);
+ XChangeProperty(disp, ret->win, prop_pid, XA_CARDINAL, sizeof(pid_t) * 8,
+ PropModeReplace, (const unsigned char *)&pid, 1);
+
XChangeProperty(disp, ret->win, prop_name, prop_utf8, 8,
PropModeReplace, (const unsigned char *)name, strlen(name));