From 9a03146d93922f188b0a068ab1fe29fd76e8e68c Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Sun, 1 Jan 2023 16:17:24 -0500 Subject: Applied autohide patch --- tabbed.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'tabbed.c') diff --git a/tabbed.c b/tabbed.c index c5bffc7..5b3def5 100644 --- a/tabbed.c +++ b/tabbed.c @@ -143,6 +143,7 @@ static void sendxembed(int c, long msg, long detail, long d1, long d2); static void setcmd(int argc, char *argv[], int); static void setup(void); static void sigchld(int unused); +static void showbar(const Arg *arg); static void spawn(const Arg *arg); static int textnw(const char *text, unsigned int len); static void toggle(const Arg *arg); @@ -169,7 +170,7 @@ static void (*handler[LASTEvent]) (const XEvent *) = { [MapRequest] = maprequest, [PropertyNotify] = propertynotify, }; -static int bh, obh, wx, wy, ww, wh; +static int bh, obh, wx, wy, ww, wh, vbh; static unsigned int numlockmask; static Bool running = True, nextfocus, doinitspawn = True, fillagain = False, closelastclient = False, @@ -186,6 +187,7 @@ static char winid[64]; static char **cmd; static char *wmname = "tabbed"; static const char *geometry; +static Bool barvisibility = False; char *argv0; @@ -358,9 +360,18 @@ void drawbar(void) { XftColor *col; - int c, cc, fc, width; + int c, cc, fc, width, nbh; char *name = NULL; + nbh = barvisibility ? vbh : 0; + if (nbh != bh) { + bh = nbh; + for (c = 0; c < nclients; c++) + XMoveResizeWindow(dpy, clients[c]->win, 0, bh, ww, wh-bh); + } + + if (bh == 0) return; + if (nclients == 0) { dc.x = 0; dc.w = ww; @@ -1052,7 +1063,7 @@ setup(void) screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); initfont(font); - bh = dc.h = dc.font.height + 2; + vbh = dc.h = dc.font.height + 2; /* init atoms */ wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); @@ -1146,6 +1157,13 @@ setup(void) focus(-1); } +void +showbar(const Arg *arg) +{ + barvisibility = arg->i; + drawbar(); +} + void sigchld(int unused) { -- cgit v1.2.3