Krolyxon
Commit e9468d3

Branches

Refs →

nsxive9468d3

Correct setting of _NET_WM_PID

The property _NET_WM_PID is a CARDINAL which per definition has format
32, whatever the size of pid_t may be.
CARDINALS (and other format 32 items) must always be passed to Xlib in
long's, whatever the size of long may be.
Author
Kim Woelders
Date
2022-03-31 06:34 +0200
Committer
N-R-K · 2022-03-31 14:52 +0000
Parent
bf6c062
Commit
e9468d3d3670ceddbababe312a3523f473159306

+2 −2

1 file changed

  1. M window.c +2 −2
M window.c View
@@ -189,7 +189,7 @@ void win_open(win_t *win)
189189 int gmask;
190190 XSizeHints sizehints;
191191 XWMHints hints;
192− pid_t pid;
192+ long pid;
193193 char hostname[256];
194194 XSetWindowAttributes attrs;
195195 char res_class[] = RES_CLASS;
@@ -247,7 +247,7 @@ void win_open(win_t *win)
247247 /* set the _NET_WM_PID */
248248 pid = getpid();
249249 XChangeProperty(e->dpy, win->xwin, atoms[ATOM__NET_WM_PID], XA_CARDINAL,
250− sizeof(pid_t) * 8, PropModeReplace, (unsigned char *) &pid, 1);
250+ 32, PropModeReplace, (unsigned char *) &pid, 1);
251251 if (gethostname(hostname, ARRLEN(hostname)) == 0) {
252252 XTextProperty tp;
253253 tp.value = (unsigned char *)hostname;