Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
fixed
[dwm.git]
/
tag.c
diff --git
a/tag.c
b/tag.c
index
f6f4535
..
cdb0f52
100644
(file)
--- a/
tag.c
+++ b/
tag.c
@@
-47,12
+47,13
@@
dofloat(Arg *arg)
else
ban(c);
}
else
ban(c);
}
- if((sel = getnext(clients))) {
+ if(!sel || !isvisible(sel))
+ sel = getnext(clients);
+ if(sel)
focus(sel);
focus(sel);
- restack();
- }
else
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
else
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ restack();
}
void
}
void
@@
-111,7
+112,9
@@
dotile(Arg *arg)
else
ban(c);
}
else
ban(c);
}
- if((sel = getnext(clients)))
+ if(!sel || !isvisible(sel))
+ sel = getnext(clients);
+ if(sel)
focus(sel);
else
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
focus(sel);
else
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
@@
-269,14
+272,18
@@
tag(Arg *arg)
sel->tags[i] = False;
sel->tags[arg->i] = True;
settitle(sel);
sel->tags[i] = False;
sel->tags[arg->i] = True;
settitle(sel);
- arrange(NULL);
+ if(!isvisible(sel))
+ arrange(NULL);
}
void
togglemode(Arg *arg)
{
arrange = arrange == dofloat ? dotile : dofloat;
}
void
togglemode(Arg *arg)
{
arrange = arrange == dofloat ? dotile : dofloat;
- arrange(NULL);
+ if(sel)
+ arrange(NULL);
+ else
+ drawstatus();
}
void
}
void
@@
-292,6
+299,8
@@
toggletag(Arg *arg)
if(i == ntags)
sel->tags[arg->i] = True;
settitle(sel);
if(i == ntags)
sel->tags[arg->i] = True;
settitle(sel);
+ if(!isvisible(sel))
+ arrange(NULL);
}
}