mirror of
git://git.suckless.org/dwm
synced 2026-03-02 17:35:52 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3dd6a829b | ||
|
|
5c9f30300b | ||
|
|
397d618f1c |
22
dwm.c
22
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;
|
||||
}
|
||||
@ -1470,12 +1470,10 @@ sendevent(Client *c, Atom proto)
|
||||
void
|
||||
setfocus(Client *c)
|
||||
{
|
||||
if (!c->neverfocus) {
|
||||
if (!c->neverfocus)
|
||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||
XChangeProperty(dpy, root, netatom[NetActiveWindow],
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
(unsigned char *) &(c->win), 1);
|
||||
}
|
||||
XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32,
|
||||
PropModeReplace, (unsigned char *)&c->win, 1);
|
||||
sendevent(c, wmatom[WMTakeFocus]);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user