about summary refs log tree commit diff stats
path: root/util.c
); } else XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); } if(!sel || !isvisible(sel)) { for(c = stack; c && !isvisible(c); c = c->snext); focus(c); } restack();}voiddotile(void) { unsigned int i, n, mw, mh, tw, th; Client *c; for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) n++; /* window geoms */ mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1); mw = (n > nmaster) ? (waw * master) / 1000 : waw; th = (n > nmaster) ? wah / (n - nmaster) : 0; tw = waw - mw; for(i = 0, c = clients; c; c = c->next) if(isvisible(c)) { if(c->isfloat) { resize(c, True, TopLeft); continue; } c->ismax = False; c->x = wax; c->y = way; if(i < nmaster) { c->y += i * mh; c->w = mw - 2 * BORDERPX; c->h = mh - 2 * BORDERPX; } else { /* tile window */ c->x += mw; c->w = tw - 2 * BORDERPX; if(th > bh) { c->y += (i - nmaster) * th; c->h = th - 2 * BORDERPX; } else /* fallback if th < bh */ c->h = wah - 2 * BORDERPX; } resize(c, False, TopLeft); i++; } else XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); if(!sel || !isvisible(sel)) { for(c = stack; c && !isvisible(c); c = c->snext); focus(c); } restack();}voidfocusnext(Arg *arg) { Client *c; if(!sel) return; if(!(c = getnext(sel->next))) c = getnext(clients); if(c) { focus(c); restack(); }}voidfocusprev(Arg *arg) { Client *c; if(!sel) return; if(!(c = getprev(sel->prev))) { for(c = clients; c && c->next; c = c->next); c = getprev(c); } if(c) { focus(c); restack(); }}voidincnmaster(Arg *arg) { if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) return; nmaster += arg->i; if(sel) arrange(); else drawstatus();}Boolisvisible(Client *c) { unsigned int i; for(i = 0; i < ntags; i++) if(c->tags[i] && seltag[i]) return True; return False;}voidresizemaster(Arg *arg) { if(arg->i == 0) master = MASTER; else { if(master + arg->i > 950 || master + arg->i < 50) return; master += arg->i; } arrange();}voidrestack(void) { Client *c; XEvent ev; drawstatus(); if(!sel) return; if(sel->isfloat || arrange == dofloat) XRaiseWindow(dpy, sel->win); if(arrange != dofloat) { if(!sel->isfloat) XLowerWindow(dpy, sel->win); for(c = nexttiled(clients); c; c = nexttiled(c->next)) { if(c == sel) continue; XLowerWindow(dpy, c->win); } } XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));}voidtogglefloat(Arg *arg) { if (!sel || arrange == dofloat) return; sel->isfloat = !sel->isfloat; arrange();}voidtogglemode(Arg *arg) { arrange = (arrange == dofloat) ? dotile : dofloat; if(sel) arrange(); else drawstatus();}voidtoggleview(Arg *arg) { unsigned int i; seltag[arg->i] = !seltag[arg->i]; for(i = 0; i < ntags && !seltag[i]; i++); if(i == ntags) seltag[arg->i] = True; /* cannot toggle last view */ arrange();}voidview(Arg *arg) { unsigned int i; for(i = 0; i < ntags; i++) seltag[i] = (arg->i == -1) ? True : False; if(arg->i >= 0 && arg->i < ntags) seltag[arg->i] = True; arrange();}voidzoom(Arg *arg) { unsigned int n; Client *c; if(!sel) return; if(sel->isfloat || (arrange == dofloat)) { togglemax(sel); return; } for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) n++; if((c = sel) == nexttiled(clients)) if(!(c = nexttiled(c->next))) return; detach(c); if(clients) clients->prev = c; c->next = clients; clients = c; focus(c); arrange();}
Commit message (Collapse)AuthorAgeFilesLines
* referred to LICENSE file 4.2Anselm R. Garbe2007-05-301-6/+1
|
* Jukka also belongs to Copyright holders after all he has contributed and ↵Anselm R. Garbe2007-05-301-0/+1
| | | | done for dwm, updated -v as well
* added nsz to copyright holders as well, because he did a lot recentlyAnselm R. Garbe2007-05-291-0/+1
|
* added anydot to Copyright holders, because he contributed a lot recentlyAnselm R. Garbe2007-05-291-0/+1
|
* yet another fix of copyright compactisitionAnselm R. Garbe2007-04-131-1/+2
|
* making Copyright notices more compactAnselm R. Garbe2007-04-131-3/+2
|
* replaced Arg union with const char *arg, seems cleaner to me, even if we ↵Anselm R. Garbe2007-02-221-4/+4
| | | | need atoi() in some places
* several changes, made togglemax extern and separated it from zoom() - moved ↵Anselm R. Garbe2007-02-221-4/+4
| | | | zoom() and togglemax() into layout.c, changed void (*func)(Arg *) into void (*func)(Arg), changed default keybindings of focusnext/focusprev and incmasterw to h/j/k/l accordingly, made keys in config*h appear alphabetically (special keys first), renamed resizemaster into incmasterw, renamed MASTER into MASTERWIDTH
* removed erealloc (not used) 3.1Anselm R. Garbe2007-01-161-9/+0
|
* correctionsarg@mig292007-01-021-1/+1
|
* next version will contain updated copyright noticearg@mig292007-01-021-1/+1
|
* code polishing, removed unnecessary newlinesAnselm R. Garbe2006-10-061-3/+2
|
* reviewed util.carg@mmvi2006-09-201-1/+2
|
* removed a bunch of lines through making function signatures more consistent ↵Anselm R. Garbe2006-09-121-8/+4
| | | | with my style ( { does not belong to a new line, if function args are single-lined)
* added a comment to spawn 1.1Anselm R. Garbe2006-08-281-0/+1
|
* eliminated sentinel warningAnselm R. Garbe2006-08-231-1/+1
|
* removed badmalloc (thx for the pointer to Uriel)Anselm R. Garbe2006-08-221-10/+2
|
* small renamings of two static functionsAnselm R.Garbe2006-08-211-3/+3
|
* implemented restack behavior (floats are on top in tiled mode)Anselm R.Garbe2006-08-141-0/+9
|
* applied grabbing-- and shell_minimalarg@10ksloc.org2006-08-071-1/+1
|
* using execl now, argv changed, using cmd and const char defs directly in the ↵arg@10ksloc.org2006-08-041-4/+7
| | | | KEYS struct
* small stylistic fixarg@10ksloc.org2006-08-041-1/+2
|
* made fullscreen apps working fine in floating mode (there is no sane way to ↵arg@10ksloc.org2006-08-021-1/+0
| | | | make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
* some cleanups/fixes inspired by Jukka Salmi's feedbackarg@10ksloc.org2006-07-211-4/+2
|
* cleaned up codearg@10ksloc.org2006-07-201-0/+3
|
* using EXIT_stuff in exit() nowAnselm R. Garbe2006-07-181-3/+3
|
* ordered variables in structs and source files alphabeticallyAnselm R. Garbe2006-07-171-2/+2
|
* proceeded with cleaning up, sorting functions, etcAnselm R. Garbe2006-07-151-11/+13
|
* rearranged several stuffAnselm R. Garbe2006-07-151-1/+1
|
* removed a bunch of lines through swap removalAnselm R. Garbe2006-07-141-8/+0
|
* searching for a better way to discard enter notifiesAnselm R. Garbe2006-07-141-28/+0
|
* implemented tagging a clientAnselm R. Garbe2006-07-131-1/+2
|
* changed default colorsAnselm R. Garbe2006-07-131-1/+1
|
* added logo+descriptionAnselm R. Garbe2006-07-131-1/+1
|
* new stuff (some warning elimination)Anselm R. Garbe2006-07-131-2/+2
|
* removed unnecessary crapAnselm R. Garbe2006-07-131-49/+2
|
* new stuff, fixed several issuesAnselm R. Garbe2006-07-121-2/+3
|
* several changes, new stuffAnselm R. Garbe2006-07-111-1/+1
|
* removed unnecessary sel stuffAnselm R. Garbe2006-07-111-38/+0
|
* added bar event timerAnselm R. Garbe2006-07-111-17/+8
|
* added gridsel to gridwmAnselm R. Garbe2006-07-111-0/+38
|
* fixed several stuff (gridwm gets better and better)Anselm R. Garbe2006-07-111-6/+7
|
* implemented pipe_spawnAnselm R. Garbe2006-07-111-4/+52
|
* added several other stuffAnselm R. Garbe2006-07-101-0/+23