moved focus{next,prev} and nexttiled from client.c to layout.c (because those are not client-specific), moved toggleversatile() from layout.c to client.c (because those are client-specific)
This commit is contained in:
46
layout.c
46
layout.c
@ -68,6 +68,38 @@ LAYOUTS
|
||||
|
||||
/* extern */
|
||||
|
||||
void
|
||||
focusnext(Arg *arg) {
|
||||
Client *c;
|
||||
|
||||
if(!sel)
|
||||
return;
|
||||
for(c = sel->next; c && !isvisible(c); c = c->next);
|
||||
if(!c)
|
||||
for(c = clients; c && !isvisible(c); c = c->next);
|
||||
if(c) {
|
||||
focus(c);
|
||||
restack();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
focusprev(Arg *arg) {
|
||||
Client *c;
|
||||
|
||||
if(!sel)
|
||||
return;
|
||||
for(c = sel->prev; c && !isvisible(c); c = c->prev);
|
||||
if(!c) {
|
||||
for(c = clients; c && c->next; c = c->next);
|
||||
for(; c && !isvisible(c); c = c->prev);
|
||||
}
|
||||
if(c) {
|
||||
focus(c);
|
||||
restack();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
incnmaster(Arg *arg) {
|
||||
if((lt->arrange != tile) || (nmaster + arg->i < 1)
|
||||
@ -93,6 +125,12 @@ initlayouts(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Client *
|
||||
nexttiled(Client *c) {
|
||||
for(; c && (c->isversatile || !isvisible(c)); c = c->next);
|
||||
return c;
|
||||
}
|
||||
|
||||
void
|
||||
resizemaster(Arg *arg) {
|
||||
if(lt->arrange != tile)
|
||||
@ -153,14 +191,6 @@ setlayout(Arg *arg) {
|
||||
drawstatus();
|
||||
}
|
||||
|
||||
void
|
||||
toggleversatile(Arg *arg) {
|
||||
if(!sel || lt->arrange == versatile)
|
||||
return;
|
||||
sel->isversatile = !sel->isversatile;
|
||||
lt->arrange();
|
||||
}
|
||||
|
||||
void
|
||||
versatile(void) {
|
||||
Client *c;
|
||||
|
Reference in New Issue
Block a user