diff options
Diffstat (limited to 'layout.c')
| -rw-r--r-- | layout.c | 46 |
1 files changed, 38 insertions, 8 deletions
| @@ -69,6 +69,38 @@ LAYOUTS | |||
| 69 | /* extern */ | 69 | /* extern */ |
| 70 | 70 | ||
| 71 | void | 71 | void |
| 72 | focusnext(Arg *arg) { | ||
| 73 | Client *c; | ||
| 74 | |||
| 75 | if(!sel) | ||
| 76 | return; | ||
| 77 | for(c = sel->next; c && !isvisible(c); c = c->next); | ||
| 78 | if(!c) | ||
| 79 | for(c = clients; c && !isvisible(c); c = c->next); | ||
| 80 | if(c) { | ||
| 81 | focus(c); | ||
| 82 | restack(); | ||
| 83 | } | ||
| 84 | } | ||
| 85 | |||
| 86 | void | ||
| 87 | focusprev(Arg *arg) { | ||
| 88 | Client *c; | ||
| 89 | |||
| 90 | if(!sel) | ||
| 91 | return; | ||
| 92 | for(c = sel->prev; c && !isvisible(c); c = c->prev); | ||
| 93 | if(!c) { | ||
| 94 | for(c = clients; c && c->next; c = c->next); | ||
| 95 | for(; c && !isvisible(c); c = c->prev); | ||
| 96 | } | ||
| 97 | if(c) { | ||
| 98 | focus(c); | ||
| 99 | restack(); | ||
| 100 | } | ||
| 101 | } | ||
| 102 | |||
| 103 | void | ||
| 72 | incnmaster(Arg *arg) { | 104 | incnmaster(Arg *arg) { |
| 73 | if((lt->arrange != tile) || (nmaster + arg->i < 1) | 105 | if((lt->arrange != tile) || (nmaster + arg->i < 1) |
| 74 | || (wah / (nmaster + arg->i) <= 2 * BORDERPX)) | 106 | || (wah / (nmaster + arg->i) <= 2 * BORDERPX)) |
| @@ -93,6 +125,12 @@ initlayouts(void) { | |||
| 93 | } | 125 | } |
| 94 | } | 126 | } |
| 95 | 127 | ||
| 128 | Client * | ||
| 129 | nexttiled(Client *c) { | ||
| 130 | for(; c && (c->isversatile || !isvisible(c)); c = c->next); | ||
| 131 | return c; | ||
| 132 | } | ||
| 133 | |||
| 96 | void | 134 | void |
| 97 | resizemaster(Arg *arg) { | 135 | resizemaster(Arg *arg) { |
| 98 | if(lt->arrange != tile) | 136 | if(lt->arrange != tile) |
| @@ -154,14 +192,6 @@ setlayout(Arg *arg) { | |||
| 154 | } | 192 | } |
| 155 | 193 | ||
| 156 | void | 194 | void |
| 157 | toggleversatile(Arg *arg) { | ||
| 158 | if(!sel || lt->arrange == versatile) | ||
| 159 | return; | ||
| 160 | sel->isversatile = !sel->isversatile; | ||
| 161 | lt->arrange(); | ||
| 162 | } | ||
| 163 | |||
| 164 | void | ||
| 165 | versatile(void) { | 195 | versatile(void) { |
| 166 | Client *c; | 196 | Client *c; |
| 167 | 197 | ||
