code polishing, removed unnecessary newlines

pull/1/head
Anselm R. Garbe 18 years ago
parent acdea31916
commit 6651dd7fd9
  1. 18
      client.c
  2. 3
      config.arg.h
  3. 3
      config.default.h
  4. 14
      draw.c
  5. 3
      dwm.h
  6. 7
      event.c
  7. 30
      main.c
  8. 6
      tag.c
  9. 5
      util.c
  10. 18
      view.c

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include "dwm.h" #include "dwm.h"
@ -156,7 +155,6 @@ gravitate(Client *c, Bool invert) {
dy = -(c->h); dy = -(c->h);
break; break;
} }
switch (c->grav) { switch (c->grav) {
default: default:
break; break;
@ -177,7 +175,6 @@ gravitate(Client *c, Bool invert) {
dx = -(c->w + c->border); dx = -(c->w + c->border);
break; break;
} }
if(invert) { if(invert) {
dx = -dx; dx = -dx;
dy = -dy; dy = -dy;
@ -210,10 +207,8 @@ manage(Window w, XWindowAttributes *wa) {
c->w = c->tw = wa->width; c->w = c->tw = wa->width;
c->h = wa->height; c->h = wa->height;
c->th = bh; c->th = bh;
c->border = 0; c->border = 0;
updatesize(c); updatesize(c);
if(c->x + c->w + 2 * BORDERPX > sw) if(c->x + c->w + 2 * BORDERPX > sw)
c->x = sw - c->w - 2 * BORDERPX; c->x = sw - c->w - 2 * BORDERPX;
if(c->x < sx) if(c->x < sx)
@ -222,7 +217,6 @@ manage(Window w, XWindowAttributes *wa) {
c->y = sh - c->h - 2 * BORDERPX; c->y = sh - c->h - 2 * BORDERPX;
if(c->h != sh && c->y < bh) if(c->h != sh && c->y < bh)
c->y = bh; c->y = bh;
c->proto = getproto(c->win); c->proto = getproto(c->win);
XSelectInput(dpy, c->win, XSelectInput(dpy, c->win,
StructureNotifyMask | PropertyChangeMask | EnterWindowMask); StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
@ -230,12 +224,10 @@ manage(Window w, XWindowAttributes *wa) {
twa.override_redirect = 1; twa.override_redirect = 1;
twa.background_pixmap = ParentRelative; twa.background_pixmap = ParentRelative;
twa.event_mask = ExposureMask | EnterWindowMask; twa.event_mask = ExposureMask | EnterWindowMask;
c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, c->twin = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
0, DefaultDepth(dpy, screen), CopyFromParent, 0, DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen), DefaultVisual(dpy, screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
grabbuttons(c, False); grabbuttons(c, False);
updatetitle(c); updatetitle(c);
settags(c, getclient(trans)); settags(c, getclient(trans));
@ -244,13 +236,11 @@ manage(Window w, XWindowAttributes *wa) {
|| (c->maxw && c->minw && || (c->maxw && c->minw &&
c->maxw == c->minw && c->maxh == c->minh); c->maxw == c->minw && c->maxh == c->minh);
resizetitle(c); resizetitle(c);
if(clients) if(clients)
clients->prev = c; clients->prev = c;
c->next = clients; c->next = clients;
c->snext = stack; c->snext = stack;
stack = clients = c; stack = clients = c;
ban(c); ban(c);
XMapWindow(dpy, c->win); XMapWindow(dpy, c->win);
XMapWindow(dpy, c->twin); XMapWindow(dpy, c->twin);
@ -283,7 +273,6 @@ resize(Client *c, Bool sizehints, Corner sticky) {
c->x = right - c->w; c->x = right - c->w;
if(sticky == BotLeft || sticky == BotRight) if(sticky == BotLeft || sticky == BotRight)
c->y = bottom - c->h; c->y = bottom - c->h;
/* offscreen appearance fixes */ /* offscreen appearance fixes */
if(c->x + c->w < sx) if(c->x + c->w < sx)
c->x = sx; c->x = sx;
@ -293,7 +282,6 @@ resize(Client *c, Bool sizehints, Corner sticky) {
c->x = sw - c->w; c->x = sw - c->w;
if(c->y > sh) if(c->y > sh)
c->y = sh - c->h; c->y = sh - c->h;
resizetitle(c); resizetitle(c);
wc.x = c->x; wc.x = c->x;
wc.y = c->y; wc.y = c->y;
@ -392,20 +380,16 @@ unmanage(Client *c) {
/* The server grab construct avoids race conditions. */ /* The server grab construct avoids race conditions. */
XGrabServer(dpy); XGrabServer(dpy);
XSetErrorHandler(xerrordummy); XSetErrorHandler(xerrordummy);
detach(c); detach(c);
detachstack(c); detachstack(c);
if(sel == c) { if(sel == c) {
for(nc = stack; nc && !isvisible(nc); nc = nc->snext); for(nc = stack; nc && !isvisible(nc); nc = nc->snext);
focus(nc); focus(nc);
} }
XUngrabButton(dpy, AnyButton, AnyModifier, c->win); XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
XDestroyWindow(dpy, c->twin); XDestroyWindow(dpy, c->twin);
free(c->tags); free(c->tags);
free(c); free(c);
XSync(dpy, False); XSync(dpy, False);
XSetErrorHandler(xerror); XSetErrorHandler(xerror);
XUngrabServer(dpy); XUngrabServer(dpy);

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */

@ -1,5 +1,4 @@
/* /* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include "dwm.h" #include "dwm.h"
@ -30,21 +29,17 @@ drawtext(const char *text, unsigned long col[ColLast], Bool highlight) {
XSetForeground(dpy, dc.gc, col[ColBG]); XSetForeground(dpy, dc.gc, col[ColBG]);
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
if(!text) if(!text)
return; return;
w = 0; w = 0;
olen = len = strlen(text); olen = len = strlen(text);
if(len >= sizeof(buf)) if(len >= sizeof(buf))
len = sizeof(buf) - 1; len = sizeof(buf) - 1;
memcpy(buf, text, len); memcpy(buf, text, len);
buf[len] = 0; buf[len] = 0;
h = dc.font.ascent + dc.font.descent; h = dc.font.ascent + dc.font.descent;
y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent; y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
x = dc.x + (h / 2); x = dc.x + (h / 2);
/* shorten text if necessary */ /* shorten text if necessary */
while(len && (w = textnw(buf, len)) > dc.w - h) while(len && (w = textnw(buf, len)) > dc.w - h)
buf[--len] = 0; buf[--len] = 0;
@ -56,7 +51,6 @@ drawtext(const char *text, unsigned long col[ColLast], Bool highlight) {
if(len > 3) if(len > 3)
buf[len - 3] = '.'; buf[len - 3] = '.';
} }
if(w > dc.w) if(w > dc.w)
return; /* too long */ return; /* too long */
gcv.foreground = col[ColFG]; gcv.foreground = col[ColFG];
@ -93,7 +87,6 @@ drawstatus(void) {
int i, x; int i, x;
dc.x = dc.y = 0; dc.x = dc.y = 0;
for(i = 0; i < ntags; i++) { for(i = 0; i < ntags; i++) {
dc.w = textw(tags[i]); dc.w = textw(tags[i]);
if(seltag[i]) if(seltag[i])
@ -102,10 +95,8 @@ drawstatus(void) {
drawtext(tags[i], dc.norm, sel && sel->tags[i]); drawtext(tags[i], dc.norm, sel && sel->tags[i]);
dc.x += dc.w; dc.x += dc.w;
} }
dc.w = bmw; dc.w = bmw;
drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False); drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False);
x = dc.x + dc.w; x = dc.x + dc.w;
dc.w = textw(stext); dc.w = textw(stext);
dc.x = bx + bw - dc.w; dc.x = bx + bw - dc.w;
@ -114,7 +105,6 @@ drawstatus(void) {
dc.w = bw - x; dc.w = bw - x;
} }
drawtext(stext, dc.status, False); drawtext(stext, dc.status, False);
if((dc.w = dc.x - x) > bh) { if((dc.w = dc.x - x) > bh) {
dc.x = x; dc.x = x;
if(sel) if(sel)
@ -134,7 +124,6 @@ drawtitle(Client *c) {
XSetWindowBorder(dpy, c->win, dc.sel[ColBG]); XSetWindowBorder(dpy, c->win, dc.sel[ColBG]);
return; return;
} }
XSetWindowBorder(dpy, c->win, dc.norm[ColBG]); XSetWindowBorder(dpy, c->win, dc.norm[ColBG]);
XMapWindow(dpy, c->twin); XMapWindow(dpy, c->twin);
dc.x = dc.y = 0; dc.x = dc.y = 0;
@ -177,7 +166,6 @@ setfont(const char *fontstr) {
XFontSetExtents *font_extents; XFontSetExtents *font_extents;
XFontStruct **xfonts; XFontStruct **xfonts;
char **font_names; char **font_names;
dc.font.ascent = dc.font.descent = 0; dc.font.ascent = dc.font.descent = 0;
font_extents = XExtentsOfFontSet(dc.font.set); font_extents = XExtentsOfFontSet(dc.font.set);
n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names); n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
* *
* dynamic window manager is designed like any other X client as well. It is * dynamic window manager is designed like any other X client as well. It is

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include "dwm.h" #include "dwm.h"
@ -211,7 +210,6 @@ enternotify(XEvent *e) {
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return; return;
if(((c = getclient(ev->window)) || (c = getctitle(ev->window))) && isvisible(c)) if(((c = getclient(ev->window)) || (c = getctitle(ev->window))) && isvisible(c))
focus(c); focus(c);
else if(ev->window == root) { else if(ev->window == root) {
@ -279,13 +277,11 @@ maprequest(XEvent *e) {
if(!XGetWindowAttributes(dpy, ev->window, &wa)) if(!XGetWindowAttributes(dpy, ev->window, &wa))
return; return;
if(wa.override_redirect) { if(wa.override_redirect) {
XSelectInput(dpy, ev->window, XSelectInput(dpy, ev->window,
(StructureNotifyMask | PropertyChangeMask)); (StructureNotifyMask | PropertyChangeMask));
return; return;
} }
if(!getclient(ev->window)) if(!getclient(ev->window))
manage(ev->window, &wa); manage(ev->window, &wa);
} }
@ -298,7 +294,6 @@ propertynotify(XEvent *e) {
if(ev->state == PropertyDelete) if(ev->state == PropertyDelete)
return; /* ignore */ return; /* ignore */
if((c = getclient(ev->window))) { if((c = getclient(ev->window))) {
if(ev->atom == wmatom[WMProtocols]) { if(ev->atom == wmatom[WMProtocols]) {
c->proto = getproto(c->win); c->proto = getproto(c->win);

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
@ -93,12 +92,11 @@ setup(void) {
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
PropModeReplace, (unsigned char *) netatom, NetLast); PropModeReplace, (unsigned char *) netatom, NetLast);
/* init cursors */ /* init cursors */
cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
/* init modifier map */
modmap = XGetModifierMapping(dpy); modmap = XGetModifierMapping(dpy);
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
for (j = 0; j < modmap->max_keypermod; j++) { for (j = 0; j < modmap->max_keypermod; j++) {
@ -107,19 +105,16 @@ setup(void) {
} }
} }
XFree(modmap); XFree(modmap);
/* select for events */
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
| EnterWindowMask | LeaveWindowMask; | EnterWindowMask | LeaveWindowMask;
wa.cursor = cursor[CurNormal]; wa.cursor = cursor[CurNormal];
XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
grabkeys(); grabkeys();
initrregs(); initrregs();
for(ntags = 0; tags[ntags]; ntags++); for(ntags = 0; tags[ntags]; ntags++);
seltag = emallocz(sizeof(Bool) * ntags); seltag = emallocz(sizeof(Bool) * ntags);
seltag[0] = True; seltag[0] = True;
/* style */ /* style */
dc.norm[ColBG] = getcolor(NORMBGCOLOR); dc.norm[ColBG] = getcolor(NORMBGCOLOR);
dc.norm[ColFG] = getcolor(NORMFGCOLOR); dc.norm[ColFG] = getcolor(NORMFGCOLOR);
@ -128,13 +123,13 @@ setup(void) {
dc.status[ColBG] = getcolor(STATUSBGCOLOR); dc.status[ColBG] = getcolor(STATUSBGCOLOR);
dc.status[ColFG] = getcolor(STATUSFGCOLOR); dc.status[ColFG] = getcolor(STATUSFGCOLOR);
setfont(FONT); setfont(FONT);
/* geometry */
bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL); bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL);
sx = sy = 0; sx = sy = 0;
sw = DisplayWidth(dpy, screen); sw = DisplayWidth(dpy, screen);
sh = DisplayHeight(dpy, screen); sh = DisplayHeight(dpy, screen);
master = MASTER; master = MASTER;
/* bar */
bx = by = 0; bx = by = 0;
bw = sw; bw = sw;
dc.h = bh = dc.font.height + 2; dc.h = bh = dc.font.height + 2;
@ -146,13 +141,13 @@ setup(void) {
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
XDefineCursor(dpy, barwin, cursor[CurNormal]); XDefineCursor(dpy, barwin, cursor[CurNormal]);
XMapRaised(dpy, barwin); XMapRaised(dpy, barwin);
strcpy(stext, "dwm-"VERSION);
/* pixmap for everything */
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
dc.gc = XCreateGC(dpy, root, 0, 0); dc.gc = XCreateGC(dpy, root, 0, 0);
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
/* multihead support */
issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask); issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
strcpy(stext, "dwm-"VERSION);
} }
/* /*
@ -204,8 +199,7 @@ quit(Arg *arg) {
readin = running = False; readin = running = False;
} }
/* /* There's no way to check accesses to destroyed windows, thus those cases are
* There's no way to check accesses to destroyed windows, thus those cases are
* ignored (especially on UnmapNotify's). Other types of errors call Xlibs * ignored (especially on UnmapNotify's). Other types of errors call Xlibs
* default error handler, which may call exit. * default error handler, which may call exit.
*/ */
@ -236,21 +230,17 @@ main(int argc, char *argv[]) {
} }
else if(argc != 1) else if(argc != 1)
eprint("usage: dwm [-v]\n"); eprint("usage: dwm [-v]\n");
dpy = XOpenDisplay(0); dpy = XOpenDisplay(0);
if(!dpy) if(!dpy)
eprint("dwm: cannot open display\n"); eprint("dwm: cannot open display\n");
xfd = ConnectionNumber(dpy); xfd = ConnectionNumber(dpy);
screen = DefaultScreen(dpy); screen = DefaultScreen(dpy);
root = RootWindow(dpy, screen); root = RootWindow(dpy, screen);
otherwm = False; otherwm = False;
XSetErrorHandler(xerrorstart); XSetErrorHandler(xerrorstart);
/* this causes an error if some other window manager is running */ /* this causes an error if some other window manager is running */
XSelectInput(dpy, root, SubstructureRedirectMask); XSelectInput(dpy, root, SubstructureRedirectMask);
XSync(dpy, False); XSync(dpy, False);
if(otherwm) if(otherwm)
eprint("dwm: another window manager is already running\n"); eprint("dwm: another window manager is already running\n");
@ -258,7 +248,6 @@ main(int argc, char *argv[]) {
XSetErrorHandler(NULL); XSetErrorHandler(NULL);
xerrorxlib = XSetErrorHandler(xerror); xerrorxlib = XSetErrorHandler(xerror);
XSync(dpy, False); XSync(dpy, False);
setup(); setup();
drawstatus(); drawstatus();
scan(); scan();
@ -291,6 +280,5 @@ main(int argc, char *argv[]) {
} }
cleanup(); cleanup();
XCloseDisplay(dpy); XCloseDisplay(dpy);
return 0; return 0;
} }

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include "dwm.h" #include "dwm.h"
@ -53,7 +52,6 @@ initrregs(void) {
return; return;
len = sizeof(rule) / sizeof(rule[0]); len = sizeof(rule) / sizeof(rule[0]);
rreg = emallocz(len * sizeof(RReg)); rreg = emallocz(len * sizeof(RReg));
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {
if(rule[i].clpattern) { if(rule[i].clpattern) {
reg = emallocz(sizeof(regex_t)); reg = emallocz(sizeof(regex_t));
@ -115,7 +113,6 @@ tag(Arg *arg) {
if(!sel) if(!sel)
return; return;
for(i = 0; i < ntags; i++) for(i = 0; i < ntags; i++)
sel->tags[i] = False; sel->tags[i] = False;
sel->tags[arg->i] = True; sel->tags[arg->i] = True;
@ -129,7 +126,6 @@ toggletag(Arg *arg) {
if(!sel) if(!sel)
return; return;
sel->tags[arg->i] = !sel->tags[arg->i]; sel->tags[arg->i] = !sel->tags[arg->i];
for(i = 0; i < ntags && !sel->tags[i]; i++); for(i = 0; i < ntags && !sel->tags[i]; i++);
if(i == ntags) if(i == ntags)

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include "dwm.h" #include "dwm.h"
@ -33,6 +32,7 @@ eprint(const char *errstr, ...) {
void * void *
erealloc(void *ptr, unsigned int size) { erealloc(void *ptr, unsigned int size) {
void *res = realloc(ptr, size); void *res = realloc(ptr, size);
if(!res) if(!res)
eprint("fatal: could not malloc() %u bytes\n", size); eprint("fatal: could not malloc() %u bytes\n", size);
return res; return res;
@ -44,7 +44,6 @@ spawn(Arg *arg) {
if(!shell && !(shell = getenv("SHELL"))) if(!shell && !(shell = getenv("SHELL")))
shell = "/bin/sh"; shell = "/bin/sh";
if(!arg->cmd) if(!arg->cmd)
return; return;
/* The double-fork construct avoids zombie processes and keeps the code /* The double-fork construct avoids zombie processes and keeps the code

@ -1,5 +1,4 @@
/* /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include "dwm.h" #include "dwm.h"
@ -43,9 +42,9 @@ reorder(void) {
} }
static void static void
togglemax(Client *c) togglemax(Client *c) {
{
XEvent ev; XEvent ev;
if((c->ismax = !c->ismax)) { if((c->ismax = !c->ismax)) {
c->rx = c->x; c->x = sx; c->rx = c->x; c->x = sx;
c->ry = c->y; c->y = bh; c->ry = c->y; c->y = bh;
@ -102,11 +101,9 @@ dotile(Arg *arg) {
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
n++; n++;
mpx = (sw * master) / 1000; mpx = (sw * master) / 1000;
stackw = sw - mpx; stackw = sw - mpx;
stackh = sh - bh; stackh = sh - bh;
th = stackh; th = stackh;
if(n > 1) if(n > 1)
th /= (n - 1); th /= (n - 1);
@ -145,6 +142,7 @@ dotile(Arg *arg) {
} }
else else
ban(c); ban(c);
if(!sel || !isvisible(sel)) { if(!sel || !isvisible(sel)) {
for(c = stack; c && !isvisible(c); c = c->snext); for(c = stack; c && !isvisible(c); c = c->snext);
focus(c); focus(c);
@ -158,7 +156,6 @@ focusnext(Arg *arg) {
if(!sel) if(!sel)
return; return;
if(!(c = getnext(sel->next))) if(!(c = getnext(sel->next)))
c = getnext(clients); c = getnext(clients);
if(c) { if(c) {
@ -173,7 +170,6 @@ focusprev(Arg *arg) {
if(!sel) if(!sel)
return; return;
if(!(c = getprev(sel->prev))) { if(!(c = getprev(sel->prev))) {
for(c = clients; c && c->next; c = c->next); for(c = clients; c && c->next; c = c->next);
c = getprev(c); c = getprev(c);
@ -204,7 +200,6 @@ resizecol(Arg *arg) {
n++; n++;
if(!sel || sel->isfloat || n < 2 || (arrange == dofloat)) if(!sel || sel->isfloat || n < 2 || (arrange == dofloat))
return; return;
if(sel == getnext(clients)) { if(sel == getnext(clients)) {
if(master + arg->i > 950 || master + arg->i < 50) if(master + arg->i > 950 || master + arg->i < 50)
return; return;
@ -290,8 +285,6 @@ viewall(Arg *arg) {
arrange(NULL); arrange(NULL);
} }
void void
zoom(Arg *arg) { zoom(Arg *arg) {
unsigned int n; unsigned int n;
@ -299,18 +292,15 @@ zoom(Arg *arg) {
if(!sel) if(!sel)
return; return;
if(sel->isfloat || (arrange == dofloat)) { if(sel->isfloat || (arrange == dofloat)) {
togglemax(sel); togglemax(sel);
return; return;
} }
for(n = 0, c = clients; c; c = c->next) for(n = 0, c = clients; c; c = c->next)
if(isvisible(c) && !c->isfloat) if(isvisible(c) && !c->isfloat)
n++; n++;
if(n < 2 || (arrange == dofloat)) if(n < 2 || (arrange == dofloat))
return; return;
if((c = sel) == nexttiled(clients)) if((c = sel) == nexttiled(clients))
if(!(c = nexttiled(c->next))) if(!(c = nexttiled(c->next)))
return; return;

Loading…
Cancel
Save