diff options
Diffstat (limited to 'layout.c')
| -rw-r--r-- | layout.c | 60 |
1 files changed, 30 insertions, 30 deletions
| @@ -31,7 +31,7 @@ tile(void) { | |||
| 31 | if(c->isbanned) | 31 | if(c->isbanned) |
| 32 | XMoveWindow(dpy, c->win, c->x, c->y); | 32 | XMoveWindow(dpy, c->win, c->x, c->y); |
| 33 | c->isbanned = False; | 33 | c->isbanned = False; |
| 34 | if(c->isuntiled) | 34 | if(c->isfloating) |
| 35 | continue; | 35 | continue; |
| 36 | c->ismax = False; | 36 | c->ismax = False; |
| 37 | nx = wax; | 37 | nx = wax; |
| @@ -70,6 +70,29 @@ LAYOUTS | |||
| 70 | /* extern */ | 70 | /* extern */ |
| 71 | 71 | ||
| 72 | void | 72 | void |
| 73 | floating(void) { | ||
| 74 | Client *c; | ||
| 75 | |||
| 76 | for(c = clients; c; c = c->next) { | ||
| 77 | if(isvisible(c)) { | ||
| 78 | if(c->isbanned) | ||
| 79 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 80 | c->isbanned = False; | ||
| 81 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 82 | } | ||
| 83 | else { | ||
| 84 | c->isbanned = True; | ||
| 85 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | if(!sel || !isvisible(sel)) { | ||
| 89 | for(c = stack; c && !isvisible(c); c = c->snext); | ||
| 90 | focus(c); | ||
| 91 | } | ||
| 92 | restack(); | ||
| 93 | } | ||
| 94 | |||
| 95 | void | ||
| 73 | focusclient(const char *arg) { | 96 | focusclient(const char *arg) { |
| 74 | Client *c; | 97 | Client *c; |
| 75 | 98 | ||
| @@ -144,7 +167,7 @@ initlayouts(void) { | |||
| 144 | 167 | ||
| 145 | Client * | 168 | Client * |
| 146 | nexttiled(Client *c) { | 169 | nexttiled(Client *c) { |
| 147 | for(; c && (c->isuntiled || !isvisible(c)); c = c->next); | 170 | for(; c && (c->isfloating || !isvisible(c)); c = c->next); |
| 148 | return c; | 171 | return c; |
| 149 | } | 172 | } |
| 150 | 173 | ||
| @@ -156,10 +179,10 @@ restack(void) { | |||
| 156 | drawstatus(); | 179 | drawstatus(); |
| 157 | if(!sel) | 180 | if(!sel) |
| 158 | return; | 181 | return; |
| 159 | if(sel->isuntiled || lt->arrange == untile) | 182 | if(sel->isfloating || lt->arrange == floating) |
| 160 | XRaiseWindow(dpy, sel->win); | 183 | XRaiseWindow(dpy, sel->win); |
| 161 | if(lt->arrange != untile) { | 184 | if(lt->arrange != floating) { |
| 162 | if(!sel->isuntiled) | 185 | if(!sel->isfloating) |
| 163 | XLowerWindow(dpy, sel->win); | 186 | XLowerWindow(dpy, sel->win); |
| 164 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { | 187 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
| 165 | if(c == sel) | 188 | if(c == sel) |
| @@ -198,7 +221,7 @@ void | |||
| 198 | togglemax(const char *arg) { | 221 | togglemax(const char *arg) { |
| 199 | XEvent ev; | 222 | XEvent ev; |
| 200 | 223 | ||
| 201 | if(!sel || (lt->arrange != untile && !sel->isuntiled) || sel->isfixed) | 224 | if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed) |
| 202 | return; | 225 | return; |
| 203 | if((sel->ismax = !sel->ismax)) { | 226 | if((sel->ismax = !sel->ismax)) { |
| 204 | sel->rx = sel->x; | 227 | sel->rx = sel->x; |
| @@ -214,34 +237,11 @@ togglemax(const char *arg) { | |||
| 214 | } | 237 | } |
| 215 | 238 | ||
| 216 | void | 239 | void |
| 217 | untile(void) { | ||
| 218 | Client *c; | ||
| 219 | |||
| 220 | for(c = clients; c; c = c->next) { | ||
| 221 | if(isvisible(c)) { | ||
| 222 | if(c->isbanned) | ||
| 223 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 224 | c->isbanned = False; | ||
| 225 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 226 | } | ||
| 227 | else { | ||
| 228 | c->isbanned = True; | ||
| 229 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 230 | } | ||
| 231 | } | ||
| 232 | if(!sel || !isvisible(sel)) { | ||
| 233 | for(c = stack; c && !isvisible(c); c = c->snext); | ||
| 234 | focus(c); | ||
| 235 | } | ||
| 236 | restack(); | ||
| 237 | } | ||
| 238 | |||
| 239 | void | ||
| 240 | zoom(const char *arg) { | 240 | zoom(const char *arg) { |
| 241 | unsigned int n; | 241 | unsigned int n; |
| 242 | Client *c; | 242 | Client *c; |
| 243 | 243 | ||
| 244 | if(!sel || lt->arrange != tile || sel->isuntiled) | 244 | if(!sel || lt->arrange != tile || sel->isfloating) |
| 245 | return; | 245 | return; |
| 246 | for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) | 246 | for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) |
| 247 | n++; | 247 | n++; |
