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.
+2 −2
1 file changed
- M window.c +2 −2
| @@ -189,7 +189,7 @@ void win_open(win_t *win) | |||
| 189 | 189 | int gmask; | |
| 190 | 190 | XSizeHints sizehints; | |
| 191 | 191 | XWMHints hints; | |
| 192 | − | pid_t pid; | |
| 192 | + | long pid; | |
| 193 | 193 | char hostname[256]; | |
| 194 | 194 | XSetWindowAttributes attrs; | |
| 195 | 195 | char res_class[] = RES_CLASS; | |
| @@ -247,7 +247,7 @@ void win_open(win_t *win) | |||
| 247 | 247 | /* set the _NET_WM_PID */ | |
| 248 | 248 | pid = getpid(); | |
| 249 | 249 | 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); | |
| 251 | 251 | if (gethostname(hostname, ARRLEN(hostname)) == 0) { | |
| 252 | 252 | XTextProperty tp; | |
| 253 | 253 | tp.value = (unsigned char *)hostname; | |