commit f8cf5238423fe85758251e83adeef21b77589ffb Author: Jan Friesse Date: Sat May 1 15:06:26 2010 +0200 Support bar on the bottom diff --git a/config.def.h b/config.def.h index 402cf25..9955448 100644 --- a/config.def.h +++ b/config.def.h @@ -7,6 +7,7 @@ static const char *before = "<"; static const char *after = ">"; static const int tabwidth = 200; static const Bool foreground = False; +static const Bool bottombar = False; #define MODKEY ControlMask static Key keys[] = { \ diff --git a/tabbed.c b/tabbed.c index 048ab37..25167ff 100644 --- a/tabbed.c +++ b/tabbed.c @@ -221,14 +221,18 @@ clientmessage(const XEvent *e) { void configurenotify(const XEvent *e) { const XConfigureEvent *ev = &e->xconfigure; + Client *c; if(ev->window == win && (ev->width != ww || ev->height != wh)) { ww = ev->width; wh = ev->height; XFreePixmap(dpy, dc.drawable); dc.drawable = XCreatePixmap(dpy, root, ww, wh, DefaultDepth(dpy, screen)); - if(sel) + if (!bottombar && sel) resize(sel, ww, wh - bh); + else + for (c = clients; c != NULL; c = c->next) + resize(c, ww, wh - bh); XSync(dpy, False); } } @@ -241,7 +245,7 @@ configurerequest(const XEvent *e) { if((c = getclient(ev->window))) { wc.x = 0; - wc.y = bh; + wc.y = (bottombar ? 0: bh); wc.width = ww; wc.height = wh - bh; wc.border_width = 0; @@ -327,7 +331,7 @@ drawbar() { dc.x += dc.w; c->tabx = dc.x; } - XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, bh, 0, 0); + XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, bh, 0, (bottombar ? wh - bh : 0)); XSync(dpy, False); } @@ -572,7 +576,7 @@ manage(Window w) { XEvent e; XWithdrawWindow(dpy, w, 0); - XReparentWindow(dpy, w, win, 0, bh); + XReparentWindow(dpy, w, win, 0, (bottombar ? 0 : bh)); XSelectInput(dpy, w, PropertyChangeMask|StructureNotifyMask|EnterWindowMask); XSync(dpy, False); for(i = 0; i < LENGTH(keys); i++) { @@ -642,7 +646,7 @@ resize(Client *c, int w, int h) { XWindowChanges wc; ce.x = 0; - ce.y = bh; + ce.y = (bottombar ? 0 : bh); ce.width = wc.width = w; ce.height = wc.height = h; ce.type = ConfigureNotify;