[wiki] [sites] [tabbed][patch][alpha] Update alpha to apply cleanly on tabbed 0.9 || m3cgx
commit 88cf5d9d3ac6378aa93cb25350c7f27b1d7307dd
Author: m3cgx <m3cgx_AT_airmail.cc>
Date: Sun Jan 25 21:41:02 2026 -0500
[tabbed][patch][alpha] Update alpha to apply cleanly on tabbed 0.9
diff --git a/tools.suckless.org/tabbed/patches/alpha/index.md b/tools.suckless.org/tabbed/patches/alpha/index.md
index 8699d88c..c550ec90 100644
--- a/tools.suckless.org/tabbed/patches/alpha/index.md
+++ b/tools.suckless.org/tabbed/patches/alpha/index.md
_AT_@ -22,6 +22,7 @@ in st.c
Download
--------
* [alpha.diff](alpha.diff) (3.8k) (28 Feb 2017)
+* [tabbed-alpha-0.9.diff](tabbed-alpha-0.9.diff) (3.9K) (2025-10-16)
Author
------
diff --git a/tools.suckless.org/tabbed/patches/alpha/tabbed-alpha-0.9.diff b/tools.suckless.org/tabbed/patches/alpha/tabbed-alpha-0.9.diff
new file mode 100644
index 00000000..13e703bd
--- /dev/null
+++ b/tools.suckless.org/tabbed/patches/alpha/tabbed-alpha-0.9.diff
_AT_@ -0,0 +1,124 @@
+diff --git a/Makefile b/Makefile
+index d7a2c35..16ceff0 100644
+--- a/Makefile
++++ b/Makefile
+_AT_@ -10,7 +10,7 @@ DOCPREFIX = ${PREFIX}/share/doc/${NAME}
+
+ # use system flags.
+ TABBED_CFLAGS = -I/usr/X11R6/include -I/usr/include/freetype2 ${CFLAGS}
+-TABBED_LDFLAGS = -L/usr/X11R6/lib -lX11 -lfontconfig -lXft ${LDFLAGS}
++TABBED_LDFLAGS = -L/usr/X11R6/lib -lX11 -lfontconfig -lXft -lXrender ${LDFLAGS}
+ TABBED_CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700L
+
+ # OpenBSD (uncomment)
+diff --git a/tabbed.c b/tabbed.c
+index aa45716..d1911a3 100644
+--- a/tabbed.c
++++ b/tabbed.c
+_AT_@ -170,6 +170,9 @@ static char **cmd;
+ static char *wmname = "tabbed";
+ static const char *geometry;
+
++static Colormap cmap;
++static Visual *visual = NULL;
++
+ char *argv0;
+
+ /* configuration, allows nested code to access above variables */
+_AT_@ -254,8 +257,8 @@ configurenotify(const XEvent *e)
+ ww = ev->width;
+ wh = ev->height;
+ XFreePixmap(dpy, dc.drawable);
+- dc.drawable = XCreatePixmap(dpy, root, ww, wh,
+- DefaultDepth(dpy, screen));
++ dc.drawable = XCreatePixmap(dpy, win, ww, wh,
++ 32);
+
+ if (!obh && (wh <= bh)) {
+ obh = bh;
+_AT_@ -407,7 +410,7 @@ drawtext(const char *text, XftColor col[ColLast])
+ ;
+ }
+
+- d = XftDrawCreate(dpy, dc.drawable, DefaultVisual(dpy, screen), DefaultColormap(dpy, screen));
++ d = XftDrawCreate(dpy, dc.drawable, visual, cmap);
+ XftDrawStringUtf8(d, &col[ColFG], dc.font.xfont, x, y, (XftChar8 *) buf, len);
+ XftDrawDestroy(d);
+ }
+_AT_@ -587,7 +590,7 @@ getcolor(const char *colstr)
+ {
+ XftColor color;
+
+- if (!XftColorAllocName(dpy, DefaultVisual(dpy, screen), DefaultColormap(dpy, screen), colstr, &color))
++ if (!XftColorAllocName(dpy, visual, cmap, colstr, &color))
+ die("%s: cannot allocate color '%s'
", argv0, colstr);
+
+ return color;
+_AT_@ -1049,18 +1052,60 @@ setup(void)
+ wy = dh + wy - wh - 1;
+ }
+
++ XVisualInfo *vis;
++ XRenderPictFormat *fmt;
++ int nvi;
++ int i;
++
++ XVisualInfo tpl = {
++ .screen = screen,
++ .depth = 32,
++ .class = TrueColor
++ };
++
++ vis = XGetVisualInfo(dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
++ for(i = 0; i < nvi; i ++) {
++ fmt = XRenderFindVisualFormat(dpy, vis[i].visual);
++ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
++ visual = vis[i].visual;
++ break;
++ }
++ }
++
++ XFree(vis);
++
++ if (! visual) {
++ fprintf(stderr, "Couldn't find ARGB visual.
");
++ exit(1);
++ }
++
++ cmap = XCreateColormap( dpy, root, visual, None);
+ dc.norm[ColBG] = getcolor(normbgcolor);
+ dc.norm[ColFG] = getcolor(normfgcolor);
+ dc.sel[ColBG] = getcolor(selbgcolor);
+ dc.sel[ColFG] = getcolor(selfgcolor);
+ dc.urg[ColBG] = getcolor(urgbgcolor);
+ dc.urg[ColFG] = getcolor(urgfgcolor);
+- dc.drawable = XCreatePixmap(dpy, root, ww, wh,
+- DefaultDepth(dpy, screen));
+- dc.gc = XCreateGC(dpy, root, 0, 0);
+
+- win = XCreateSimpleWindow(dpy, root, wx, wy, ww, wh, 0,
+- dc.norm[ColFG].pixel, dc.norm[ColBG].pixel);
++ XSetWindowAttributes attrs;
++ attrs.background_pixel = dc.norm[ColBG].pixel;
++ attrs.border_pixel = dc.norm[ColFG].pixel;
++ attrs.bit_gravity = NorthWestGravity;
++ attrs.event_mask = FocusChangeMask | KeyPressMask
++ | ExposureMask | VisibilityChangeMask | StructureNotifyMask
++ | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
++ attrs.background_pixmap = None ;
++ attrs.colormap = cmap;
++
++ win = XCreateWindow(dpy, root, wx, wy,
++ ww, wh, 0, 32, InputOutput,
++ visual, CWBackPixmap | CWBorderPixel | CWBitGravity
++ | CWEventMask | CWColormap, &attrs);
++
++ dc.drawable = XCreatePixmap(dpy, win, ww, wh,
++ 32);
++ dc.gc = XCreateGC(dpy, dc.drawable, 0, 0);
++
+ XMapRaised(dpy, win);
+ XSelectInput(dpy, win, SubstructureNotifyMask | FocusChangeMask |
+ ButtonPressMask | ExposureMask | KeyPressMask |
+--
+2.51.0
Received on Mon Jan 26 2026 - 03:43:12 CET
This archive was generated by hypermail 2.3.0
: Mon Jan 26 2026 - 03:48:43 CET