aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dwm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index fc4232e..a5e1ce9 100644
--- a/dwm.c
+++ b/dwm.c
@@ -897,10 +897,10 @@ getstate(Window w)
Atom real;
if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
- &real, &format, &n, &extra, (unsigned char **)&p) != Success)
+ &real, &format, &n, &extra, &p) != Success)
return -1;
- if (n != 0)
- result = *p;
+ if (n != 0 && format == 32)
+ result = *(long *)p;
XFree(p);
return result;
}