commit 0789daf64cada84fbd6cf927b90000f711e3b35d
parent 23c849f6e6a7c129f7b3f4f0c6705d0dabc12e85
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 16 Apr 2019 11:34:05 +0200
Add autohide patch
Diffstat:
1 file changed, 54 insertions(+), 0 deletions(-)
diff --git a/tabbed-autohide-20170824-6dc3978.diff b/tabbed-autohide-20170824-6dc3978.diff
@@ -0,0 +1,54 @@
+diff --git a/tabbed.c b/tabbed.c
+index ff3ada0..c41db0c 100644
+--- a/tabbed.c
++++ b/tabbed.c
+@@ -152,7 +152,7 @@ static void (*handler[LASTEvent]) (const XEvent *) = {
+ [MapRequest] = maprequest,
+ [PropertyNotify] = propertynotify,
+ };
+-static int bh, wx, wy, ww, wh;
++static int bh, wx, wy, ww, wh, vbh;
+ static unsigned int numlockmask;
+ static Bool running = True, nextfocus, doinitspawn = True,
+ fillagain = False, closelastclient = False,
+@@ -315,7 +315,7 @@ void
+ drawbar(void)
+ {
+ XftColor *col;
+- int c, cc, fc, width;
++ int c, cc, fc, width, nbh, i;
+ char *name = NULL;
+
+ if (nclients == 0) {
+@@ -323,12 +323,21 @@ drawbar(void)
+ dc.w = ww;
+ XFetchName(dpy, win, &name);
+ drawtext(name ? name : "", dc.norm);
+- XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, bh, 0, 0);
++ XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, ww, vbh, 0, 0);
+ XSync(dpy, False);
+
+ return;
+ }
+
++ nbh = nclients > 1 ? vbh : 0;
++ if (bh != nbh) {
++ bh = nbh;
++ for (i = 0; i < nclients; i++)
++ XMoveResizeWindow(dpy, clients[i]->win, 0, bh, ww, wh - bh);
++ }
++ if (bh == 0)
++ return;
++
+ width = ww;
+ cc = ww / tabwidth;
+ if (nclients > cc)
+@@ -975,7 +984,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);