commit 794d47c17fd8e71a6eae9c097428afd98b1f0f50
Author: Audun Sutterud <[email protected]>
Date:   Thu Aug 24 10:37:26 2017 +0200

    [tabbed] Remove screen flickering in the autohide patch
    
    The screen flickers when changing windows. The newest autohide patch 
(20170817)
    is replaced with a version of the more stable patch 
"tabbed-0.4.1-autohide.diff"
    adapted to work with tabbed version 6dc3978.
    
    The '-p' option is still supported.

diff --git a/tools.suckless.org/tabbed/patches/autohide.md 
b/tools.suckless.org/tabbed/patches/autohide.md
index 43c5b116..72e320e8 100644
--- a/tools.suckless.org/tabbed/patches/autohide.md
+++ b/tools.suckless.org/tabbed/patches/autohide.md
@@ -7,11 +7,11 @@ Download
 --------
 * [tabbed-0.4.1-autohide.diff](tabbed-0.4.1-autohide.diff)
 * [tabbed-0.5-autohide.diff](tabbed-0.5-autohide.diff)
-* 
[tabbed-autohide-20170817-6dc3978.diff](tabbed-autohide-20170817-6dc3978.diff)
+* 
[tabbed-autohide-20170824-6dc3978.diff](tabbed-autohide-20170824-6dc3978.diff)
 
 Author
 ------
 * original author  Carlos Pita - <carlosjosepita_AT_gmail.com>
 * 0.4.1  Maximilian Dietrich - <dxm_AT_lavabit.com>
 * 0.5    Maximilian Dietrich - <dxm_AT_lavabit.com>
-* 20170817  Audun Sutterud - <audunsu_AT_protonmail.com>
+* 20170824  Audun Sutterud - <audunsu_AT_protonmail.com>
diff --git 
a/tools.suckless.org/tabbed/patches/tabbed-autohide-20170817-6dc3978.diff 
b/tools.suckless.org/tabbed/patches/tabbed-autohide-20170817-6dc3978.diff
deleted file mode 100644
index 46c1a7b9..00000000
--- a/tools.suckless.org/tabbed/patches/tabbed-autohide-20170817-6dc3978.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/tabbed.c b/tabbed.c
-index ff3ada0..952c177 100644
---- a/tabbed.c
-+++ b/tabbed.c
-@@ -329,6 +329,11 @@ drawbar(void)
-               return;
-       }
- 
-+      if (nclients == 1) {
-+              XMoveResizeWindow(dpy, clients[0]->win, 0, 0, ww, wh);
-+              return;
-+      }
-+
-       width = ww;
-       cc = ww / tabwidth;
-       if (nclients > cc)
-@@ -698,6 +703,9 @@ manage(Window w)
-               Client *c;
-               XEvent e;
- 
-+              if (nclients == 1)
-+                      XMoveResizeWindow(dpy, clients[0]->win, 0, bh, ww, wh - 
bh);
-+
-               XWithdrawWindow(dpy, w, 0);
-               XReparentWindow(dpy, w, win, 0, bh);
-               XSelectInput(dpy, w, PropertyChangeMask |
diff --git 
a/tools.suckless.org/tabbed/patches/tabbed-autohide-20170824-6dc3978.diff 
b/tools.suckless.org/tabbed/patches/tabbed-autohide-20170824-6dc3978.diff
new file mode 100644
index 00000000..efe68a09
--- /dev/null
+++ b/tools.suckless.org/tabbed/patches/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);


Reply via email to