summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/screen.c b/screen.c
index 8086bd0..e0da2cf 100644
--- a/screen.c
+++ b/screen.c
@@ -19,7 +19,7 @@ Layout *lt = NULL;
19typedef struct { 19typedef 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
25typedef struct { 25typedef 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
229void 229void
230swim(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
252void
253tag(Arg *arg) { 230tag(Arg *arg) {
254 unsigned int i; 231 unsigned int i;
255 232
@@ -263,14 +240,6 @@ tag(Arg *arg) {
263} 240}
264 241
265void 242void
266toggleswimming(Arg *arg) {
267 if(!sel || lt->arrange == swim)
268 return;
269 sel->swimming = !sel->swimming;
270 lt->arrange();
271}
272
273void
274toggletag(Arg *arg) { 243toggletag(Arg *arg) {
275 unsigned int i; 244 unsigned int i;
276 245
@@ -299,6 +268,14 @@ togglelayout(Arg *arg) {
299} 268}
300 269
301void 270void
271toggleversatile(Arg *arg) {
272 if(!sel || lt->arrange == versatile)
273 return;
274 sel->versatile = !sel->versatile;
275 lt->arrange();
276}
277
278void
302toggleview(Arg *arg) { 279toggleview(Arg *arg) {
303 unsigned int i; 280 unsigned int i;
304 281
@@ -310,6 +287,29 @@ toggleview(Arg *arg) {
310} 287}
311 288
312void 289void
290versatile(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
312void
313view(Arg *arg) { 313view(Arg *arg) {
314 unsigned int i; 314 unsigned int i;
315 315