removed getnext/getprev, redundant

keyboard
Anselm R. Garbe 18 years ago
parent 3ce8c9f338
commit 8a5f002c41
  1. 2
      dwm.h
  2. 12
      tag.c
  3. 12
      view.c

@ -128,8 +128,6 @@ extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
/* tag.c */ /* tag.c */
extern void initrregs(void); /* initialize regexps of rules defined in config.h */ extern void initrregs(void); /* initialize regexps of rules defined in config.h */
extern Client *getnext(Client *c); /* returns next visible client */
extern Client *getprev(Client *c); /* returns previous visible client */
extern void settags(Client *c, Client *trans); /* sets tags of c */ extern void settags(Client *c, Client *trans); /* sets tags of c */
extern void tag(Arg *arg); /* tags c with arg's index */ extern void tag(Arg *arg); /* tags c with arg's index */
extern void toggletag(Arg *arg); /* toggles c tags with arg's index */ extern void toggletag(Arg *arg); /* toggles c tags with arg's index */

12
tag.c

@ -31,18 +31,6 @@ static unsigned int len = 0;
/* extern */ /* extern */
Client *
getnext(Client *c) {
for(; c && !isvisible(c); c = c->next);
return c;
}
Client *
getprev(Client *c) {
for(; c && !isvisible(c); c = c->prev);
return c;
}
void void
initrregs(void) { initrregs(void) {
unsigned int i; unsigned int i;

@ -8,7 +8,7 @@
static Client * static Client *
nexttiled(Client *c) { nexttiled(Client *c) {
for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); for(; c && (c->isfloat || !isvisible(c)); c = c->next);
return c; return c;
} }
@ -125,8 +125,9 @@ focusnext(Arg *arg) {
if(!sel) if(!sel)
return; return;
if(!(c = getnext(sel->next))) for(c = sel->next; c && !isvisible(c); c = c->next);
c = getnext(clients); if(!c)
for(c = clients; c && !isvisible(c); c = c->next);
if(c) { if(c) {
focus(c); focus(c);
restack(); restack();
@ -139,9 +140,10 @@ focusprev(Arg *arg) {
if(!sel) if(!sel)
return; return;
if(!(c = getprev(sel->prev))) { for(c = sel->prev; c && !isvisible(c); c = c->prev);
if(!c) {
for(c = clients; c && c->next; c = c->next); for(c = clients; c && c->next; c = c->next);
c = getprev(c); for(; c && !isvisible(c); c = c->prev);
} }
if(c) { if(c) {
focus(c); focus(c);

Loading…
Cancel
Save