aboutsummarylogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorAnselm R. Garbe2007-02-21 11:39:57 +0100
committerAnselm R. Garbe2007-02-21 11:39:57 +0100
commit1831ca5ae1d5ff91f02ab180e8b52676394050d2 (patch)
tree109447236299d61497d87a889852e1956e37112a /layout.c
parent2ce1327a79d8f0c24208ee7c4b66ba8d43441ee0 (diff)
downloadaur-1831ca5ae1d5ff91f02ab180e8b52676394050d2.tar.gz
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)
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c46
1 files changed, 38 insertions, 8 deletions
diff --git a/layout.c b/layout.c
index d754afbed24c..e5f635c7542d 100644
--- a/layout.c
+++ b/layout.c
@@ -69,6 +69,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)
|| (wah / (nmaster + arg->i) <= 2 * BORDERPX))
@@ -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)
@@ -154,14 +192,6 @@ setlayout(Arg *arg) {
}
void
-toggleversatile(Arg *arg) {
- if(!sel || lt->arrange == versatile)
- return;
- sel->isversatile = !sel->isversatile;
- lt->arrange();
-}
-
-void
versatile(void) {
Client *c;