diff options
| author | Xiao Pan <xyz@flylightning.xyz> | 2026-02-21 20:45:41 +0800 |
|---|---|---|
| committer | Xiao Pan <xyz@flylightning.xyz> | 2026-02-21 20:45:41 +0800 |
| commit | 4dcfed295dbc4f0774e9d04e5bcbc313b3f2b8df (patch) | |
| tree | 78bef2fd9b965196073bbac98a8f00de85896d77 | |
| parent | 835e199b9d3f152a53745138b6060113c5322fab (diff) | |
| parent | c3dd6a829b3f5cb9474bcca787a9c8a86932d75d (diff) | |
Merge branch 'master' into fly
| -rw-r--r-- | dwm.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -864,15 +864,15 @@ focusstack(const Arg *arg) Atom getatomprop(Client *c, Atom prop) { - int di; + int format; unsigned long nitems, dl; unsigned char *p = NULL; Atom da, atom = None; if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, - &da, &di, &nitems, &dl, &p) == Success && p) { - if (nitems > 0) - atom = *(Atom *)p; + &da, &format, &nitems, &dl, &p) == Success && p) { + if (nitems > 0 && format == 32) + atom = *(long *)p; XFree(p); } return atom; @@ -898,10 +898,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; } |
