mirror of
git://git.suckless.org/dwm
synced 2026-03-06 00:13:38 +00:00
Compare commits
2 Commits
397d618f1c
...
c3dd6a829b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3dd6a829b | ||
|
|
5c9f30300b |
14
dwm.c
14
dwm.c
@ -863,15 +863,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;
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user