aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2026-02-21 20:45:41 +0800
committerXiao Pan <xyz@flylightning.xyz>2026-02-21 20:45:41 +0800
commit4dcfed295dbc4f0774e9d04e5bcbc313b3f2b8df (patch)
tree78bef2fd9b965196073bbac98a8f00de85896d77 /dwm.c
parent835e199b9d3f152a53745138b6060113c5322fab (diff)
parentc3dd6a829b3f5cb9474bcca787a9c8a86932d75d (diff)
Merge branch 'master' into fly
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dwm.c b/dwm.c
index aacbdf5..12150b6 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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;
}