Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
dwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
applied the shorter xprop command
[dwm.git]
/
tag.c
diff --git
a/tag.c
b/tag.c
index
b5bebea
..
cdb0f52
100644
(file)
--- a/
tag.c
+++ b/
tag.c
@@
-35,20
+35,6
@@
void (*arrange)(Arg *) = DEFMODE;
/* extern */
void
/* extern */
void
-appendtag(Arg *arg)
-{
- Client *c = sel;
-
- if(!c)
- return;
-
- c->tags[arg->i] = True;
- arrange(NULL);
- focus(c);
- restack();
-}
-
-void
dofloat(Arg *arg)
{
Client *c;
dofloat(Arg *arg)
{
Client *c;
@@
-61,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
@@
-125,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);
@@
-187,19
+176,6
@@
isvisible(Client *c)
}
void
}
void
-replacetag(Arg *arg)
-{
- int i;
-
- if(!sel)
- return;
-
- for(i = 0; i < ntags; i++)
- sel->tags[i] = False;
- appendtag(arg);
-}
-
-void
restack()
{
static unsigned int nwins = 0;
restack()
{
static unsigned int nwins = 0;
@@
-285,31
+261,68
@@
settags(Client *c)
}
void
}
void
+tag(Arg *arg)
+{
+ unsigned int i;
+
+ if(!sel)
+ return;
+
+ for(i = 0; i < ntags; i++)
+ sel->tags[i] = False;
+ sel->tags[arg->i] = True;
+ settitle(sel);
+ if(!isvisible(sel))
+ arrange(NULL);
+}
+
+void
togglemode(Arg *arg)
{
arrange = arrange == dofloat ? dotile : dofloat;
togglemode(Arg *arg)
{
arrange = arrange == dofloat ? dotile : dofloat;
- arrange(NULL);
+ if(sel)
+ arrange(NULL);
+ else
+ drawstatus();
}
void
}
void
-view(Arg *arg)
+toggletag(Arg *arg)
{
unsigned int i;
{
unsigned int i;
- for(i = 0; i < ntags; i++)
- seltag[i] = False;
- seltag[arg->i] = True;
- arrange(NULL);
+ if(!sel)
+ return;
+
+ sel->tags[arg->i] = !sel->tags[arg->i];
+ for(i = 0; i < ntags && !sel->tags[i]; i++);
+ if(i == ntags)
+ sel->tags[arg->i] = True;
+ settitle(sel);
+ if(!isvisible(sel))
+ arrange(NULL);
}
}
+
void
toggleview(Arg *arg)
{
unsigned int i;
seltag[arg->i] = !seltag[arg->i];
void
toggleview(Arg *arg)
{
unsigned int i;
seltag[arg->i] = !seltag[arg->i];
- for(i = 0; !seltag[i] && i < ntags; i++);
+ for(i = 0; i < ntags && !seltag[i]; i++);
if(i == ntags)
seltag[arg->i] = True; /* cannot toggle last view */
arrange(NULL);
}
if(i == ntags)
seltag[arg->i] = True; /* cannot toggle last view */
arrange(NULL);
}
+
+void
+view(Arg *arg)
+{
+ unsigned int i;
+
+ for(i = 0; i < ntags; i++)
+ seltag[i] = False;
+ seltag[arg->i] = True;
+ arrange(NULL);
+}