diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 17:12:26 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 17:12:26 +0100 |
| commit | 6d5f67a0922d40d52290c12f9c0d937f4121406e (patch) | |
| tree | 54f519e2d10bbfd1e1be9de149d2e25ee4ee382c /screen.c | |
| parent | renamed floating into swimming (this does not clash with C naming conventions... (diff) | |
| download | dwm-6d5f67a0922d40d52290c12f9c0d937f4121406e.tar.gz dwm-6d5f67a0922d40d52290c12f9c0d937f4121406e.zip | |
renames swim[ming] into versatile
Diffstat (limited to 'screen.c')
| -rw-r--r-- | screen.c | 74 |
1 files changed, 37 insertions, 37 deletions
| @@ -19,7 +19,7 @@ Layout *lt = NULL; | |||
| 19 | typedef struct { | 19 | typedef struct { |
| 20 | const char *prop; | 20 | const char *prop; |
| 21 | const char *tags; | 21 | const char *tags; |
| 22 | Bool swimming; | 22 | Bool versatile; |
| 23 | } Rule; | 23 | } Rule; |
| 24 | 24 | ||
| 25 | typedef struct { | 25 | typedef struct { |
| @@ -52,7 +52,7 @@ tile(void) { | |||
| 52 | if(c->isbanned) | 52 | if(c->isbanned) |
| 53 | XMoveWindow(dpy, c->win, c->x, c->y); | 53 | XMoveWindow(dpy, c->win, c->x, c->y); |
| 54 | c->isbanned = False; | 54 | c->isbanned = False; |
| 55 | if(c->swimming) | 55 | if(c->versatile) |
| 56 | continue; | 56 | continue; |
| 57 | c->ismax = False; | 57 | c->ismax = False; |
| 58 | nx = wax; | 58 | nx = wax; |
| @@ -175,10 +175,10 @@ restack(void) { | |||
| 175 | drawstatus(); | 175 | drawstatus(); |
| 176 | if(!sel) | 176 | if(!sel) |
| 177 | return; | 177 | return; |
| 178 | if(sel->swimming || lt->arrange == swim) | 178 | if(sel->versatile || lt->arrange == versatile) |
| 179 | XRaiseWindow(dpy, sel->win); | 179 | XRaiseWindow(dpy, sel->win); |
| 180 | if(lt->arrange != swim) { | 180 | if(lt->arrange != versatile) { |
| 181 | if(!sel->swimming) | 181 | if(!sel->versatile) |
| 182 | XLowerWindow(dpy, sel->win); | 182 | XLowerWindow(dpy, sel->win); |
| 183 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { | 183 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
| 184 | if(c == sel) | 184 | if(c == sel) |
| @@ -208,7 +208,7 @@ settags(Client *c, Client *trans) { | |||
| 208 | ch.res_name ? ch.res_name : "", c->name); | 208 | ch.res_name ? ch.res_name : "", c->name); |
| 209 | for(i = 0; i < nrules; i++) | 209 | for(i = 0; i < nrules; i++) |
| 210 | if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { | 210 | if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { |
| 211 | c->swimming = rule[i].swimming; | 211 | c->versatile = rule[i].versatile; |
| 212 | for(j = 0; regs[i].tagregex && j < ntags; j++) { | 212 | for(j = 0; regs[i].tagregex && j < ntags; j++) { |
| 213 | if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { | 213 | if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { |
| 214 | matched = True; | 214 | matched = True; |
| @@ -227,29 +227,6 @@ settags(Client *c, Client *trans) { | |||
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | void | 229 | void |
| 230 | swim(void) { | ||
| 231 | Client *c; | ||
| 232 | |||
| 233 | for(c = clients; c; c = c->next) { | ||
| 234 | if(isvisible(c)) { | ||
| 235 | if(c->isbanned) | ||
| 236 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 237 | c->isbanned = False; | ||
| 238 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 239 | } | ||
| 240 | else { | ||
| 241 | c->isbanned = True; | ||
| 242 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 243 | } | ||
| 244 | } | ||
| 245 | if(!sel || !isvisible(sel)) { | ||
| 246 | for(c = stack; c && !isvisible(c); c = c->snext); | ||
| 247 | focus(c); | ||
| 248 | } | ||
| 249 | restack(); | ||
| 250 | } | ||
| 251 | |||
| 252 | void | ||
| 253 | tag(Arg *arg) { | 230 | tag(Arg *arg) { |
| 254 | unsigned int i; | 231 | unsigned int i; |
| 255 | 232 | ||
| @@ -263,14 +240,6 @@ tag(Arg *arg) { | |||
| 263 | } | 240 | } |
| 264 | 241 | ||
| 265 | void | 242 | void |
| 266 | toggleswimming(Arg *arg) { | ||
| 267 | if(!sel || lt->arrange == swim) | ||
| 268 | return; | ||
| 269 | sel->swimming = !sel->swimming; | ||
| 270 | lt->arrange(); | ||
| 271 | } | ||
| 272 | |||
| 273 | void | ||
| 274 | toggletag(Arg *arg) { | 243 | toggletag(Arg *arg) { |
| 275 | unsigned int i; | 244 | unsigned int i; |
| 276 | 245 | ||
| @@ -299,6 +268,14 @@ togglelayout(Arg *arg) { | |||
| 299 | } | 268 | } |
| 300 | 269 | ||
| 301 | void | 270 | void |
| 271 | toggleversatile(Arg *arg) { | ||
| 272 | if(!sel || lt->arrange == versatile) | ||
| 273 | return; | ||
| 274 | sel->versatile = !sel->versatile; | ||
| 275 | lt->arrange(); | ||
| 276 | } | ||
| 277 | |||
| 278 | void | ||
| 302 | toggleview(Arg *arg) { | 279 | toggleview(Arg *arg) { |
| 303 | unsigned int i; | 280 | unsigned int i; |
| 304 | 281 | ||
| @@ -310,6 +287,29 @@ toggleview(Arg *arg) { | |||
| 310 | } | 287 | } |
| 311 | 288 | ||
| 312 | void | 289 | void |
| 290 | versatile(void) { | ||
| 291 | Client *c; | ||
| 292 | |||
| 293 | for(c = clients; c; c = c->next) { | ||
| 294 | if(isvisible(c)) { | ||
| 295 | if(c->isbanned) | ||
| 296 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 297 | c->isbanned = False; | ||
| 298 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 299 | } | ||
| 300 | else { | ||
| 301 | c->isbanned = True; | ||
| 302 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 303 | } | ||
| 304 | } | ||
| 305 | if(!sel || !isvisible(sel)) { | ||
| 306 | for(c = stack; c && !isvisible(c); c = c->snext); | ||
| 307 | focus(c); | ||
| 308 | } | ||
| 309 | restack(); | ||
| 310 | } | ||
| 311 | |||
| 312 | void | ||
| 313 | view(Arg *arg) { | 313 | view(Arg *arg) { |
| 314 | unsigned int i; | 314 | unsigned int i; |
| 315 | 315 | ||
