[wiki] [sites] Rename st-patch argbbg to alpha || FRIGN

From: <git_AT_suckless.org>
Date: Sat, 18 Jun 2016 19:12:44 +0200

commit d078ca4678a0cb406eeb54439bff03e4541d4859
Author: FRIGN <dev_AT_frign.de>
Date: Sat Jun 18 19:10:48 2016 +0200

    Rename st-patch argbbg to alpha

diff --git a/st.suckless.org/patches/alpha.md b/st.suckless.org/patches/alpha.md
new file mode 100644
index 0000000..0f0f51e
--- /dev/null
+++ b/st.suckless.org/patches/alpha.md
_AT_@ -0,0 +1,25 @@
+alpha
+=====
+
+->[![Screenshot](st-alpha-s.png)](st-alpha.png)<-
+
+## Description ##
+This patch allows users to change the opacity of the background.
+Note that *you need an X composite manager* (e.g. compton, xcompmgr) to
+make this patch effective.
+
+## Important Notes ##
+ - The alpha value affects the default background only.
+ - The color designated by 'defaultbg' should not be used elsewhere.
+ - Embedding might fail after applying this patch.
+
+## Download ##
+ * [st-alpha-0.4.1.diff](st-alpha-0.4.1.diff)
+ * [st-alpha-0.5.diff](st-alpha-0.5.diff)
+ * [st-alpha-0.6.diff](st-alpha-0.6.diff)
+ * [st-alpha-git-20160617-528241aa.diff](st-alpha-git-20160617-528241aa.diff)
+
+## Authors ##
+ * Eon S. Jeon - esjeon_AT_hyunmu.am
+ * pr - protodev_AT_gmx.net (0.5 port)
+ * Laslo Hunhold - dev_AT_frign.de (0.6, git ports)
diff --git a/st.suckless.org/patches/argbbg.md b/st.suckless.org/patches/argbbg.md
deleted file mode 100644
index 158423c..0000000
--- a/st.suckless.org/patches/argbbg.md
+++ /dev/null
_AT_@ -1,26 +0,0 @@
-argbbg
-======
-
-->[![Screenshot](st-argbbg-s.png)](st-argbbg.png)<-
-
-## Description ##
-This patch allows users to change the opacity of the background.
-Note that *you need an X composite manager* (e.g. compton, xcompmgr) to
-make this patch effective.
-
-## Important Notes ##
- - The alpha value affects the default background only.
- - The color designated by 'defaultbg' should not be used elsewhere.
- - Embedding might fail after applying this patch.
-
-## Download ##
- * [st-argbbg-0.4.1.diff](st-argbbg-0.4.1.diff)
- * [st-argbbg-0.5.diff](st-argbbg-0.5.diff)
- * [st-argbbg-0.6.diff](st-argbbg-0.6.diff)
- * [st-argbbg-git-20160617-528241aa.diff](st-argbbg-git-20160617-528241aa.diff)
-
-## Authors ##
- * Eon S. Jeon - esjeon_AT_hyunmu.am
- * pr - protodev_AT_gmx.net (0.5 port)
- * Laslo Hunhold - dev_AT_frign.de (0.6 port)
- * David Phillips - dbphillipsnz_AT_gmail.com (git port)
diff --git a/st.suckless.org/patches/st-alpha-0.4.1.diff b/st.suckless.org/patches/st-alpha-0.4.1.diff
new file mode 100644
index 0000000..fe6b47b
--- /dev/null
+++ b/st.suckless.org/patches/st-alpha-0.4.1.diff
_AT_@ -0,0 +1,171 @@
+diff --git a/config.def.h b/config.def.h
+index d1c20bd..cc9f34d 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -25,6 +25,8 @@ static char termname[] = "st-256color";
+
+ static unsigned int tabspaces = 8;
+
++/* background opacity */
++static const int alpha = 0xdd;
+
+ /* Terminal colors (16 first used in escape sequence) */
+ static const char *colorname[] = {
+_AT_@ -52,6 +54,7 @@ static const char *colorname[] = {
+
+ /* more colors can be added after 255 to use with DefaultXX */
+ "#cccccc",
++ "black",
+ };
+
+
+_AT_@ -60,7 +63,7 @@ static const char *colorname[] = {
+ * foreground, background, cursor
+ */
+ static unsigned int defaultfg = 7;
+-static unsigned int defaultbg = 0;
++static unsigned int defaultbg = 257;
+ static unsigned int defaultcs = 256;
+
+ /*
+diff --git a/config.mk b/config.mk
+index 9431de2..0b92bf2 100644
+--- a/config.mk
++++ b/config.mk
+_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
+ INCS = -I. -I/usr/include -I${X11INC} \
+ `pkg-config --cflags fontconfig` \
+ `pkg-config --cflags freetype2`
+-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
++LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lXrender \
+ `pkg-config --libs fontconfig` \
+ `pkg-config --libs freetype2`
+
+diff --git a/st.c b/st.c
+index 686ed5d..de4d0f9 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -60,6 +60,7 @@ char *argv0;
+ #define XK_ANY_MOD UINT_MAX
+ #define XK_NO_MOD 0
+ #define XK_SWITCH_MOD (1<<13)
++#define OPAQUE 0Xff
+
+ #define REDRAW_TIMEOUT (80*1000) /* 80 ms */
+
+_AT_@ -74,6 +75,7 @@ char *argv0;
+ #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
+ #define IS_SET(flag) ((term.mode & (flag)) != 0)
+ #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
++#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
+
+ #define VT102ID "[?6c"
+
+_AT_@ -215,6 +217,7 @@ typedef struct {
+ int w, h; /* window width and height */
+ int ch; /* char height */
+ int cw; /* char width */
++ int depth; /* bit depth */
+ char state; /* focus, redraw, visible */
+ } XWindow;
+
+_AT_@ -2335,8 +2338,7 @@ xresize(int col, int row) {
+ xw.th = MAX(1, row * xw.ch);
+
+ XFreePixmap(xw.dpy, xw.buf);
+- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
++ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
+ XftDrawChange(xw.draw, xw.buf);
+ xclear(0, 0, xw.w, xw.h);
+ }
+_AT_@ -2360,6 +2362,13 @@ xloadcols(void) {
+ }
+ }
+
++ /* set alpha value of bg color */
++ if (USE_ARGB) {
++ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
++ dc.col[defaultbg].pixel &= 0x00111111;
++ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
++ }
++
+ /* load colors [16-255] ; same colors as xterm */
+ for(i = 16, r = 0; r < 6; r++) {
+ for(g = 0; g < 6; g++) {
+_AT_@ -2603,7 +2612,38 @@ xinit(void) {
+ if(!(xw.dpy = XOpenDisplay(NULL)))
+ die("Can't open display
");
+ xw.scr = XDefaultScreen(xw.dpy);
+- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ xw.depth = (USE_ARGB)? 32: XDefaultDepth(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ else {
++ XVisualInfo *vis;
++ XRenderPictFormat *fmt;
++ int nvi;
++ int i;
++
++ XVisualInfo tpl = {
++ .screen = xw.scr,
++ .depth = 32,
++ .class = TrueColor
++ };
++
++ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
++ xw.vis = NULL;
++ for(i = 0; i < nvi; i ++) {
++ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
++ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
++ xw.vis = vis[i].visual;
++ break;
++ }
++ }
++
++ XFree(vis);
++
++ if (! xw.vis) {
++ fprintf(stderr, "Couldn't find ARGB visual.
");
++ exit(1);
++ }
++ }
+
+ /* font */
+ if(!FcInit())
+_AT_@ -2613,7 +2653,10 @@ xinit(void) {
+ xloadfonts(usedfont, 0);
+
+ /* colors */
+- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ else
++ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
+ xloadcols();
+
+ /* adjust fixed window geometry */
+_AT_@ -2647,7 +2690,7 @@ xinit(void) {
+ parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
+ XRootWindow(xw.dpy, xw.scr);
+ xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy,
+- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
++ xw.w, xw.h, 0, xw.depth, InputOutput,
+ xw.vis,
+ CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
+ | CWColormap,
+_AT_@ -2655,10 +2698,11 @@ xinit(void) {
+
+ memset(&gcvalues, 0, sizeof(gcvalues));
+ gcvalues.graphics_exposures = False;
+- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
++ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
++ dc.gc = XCreateGC(xw.dpy,
++ (USE_ARGB)? xw.buf: parent,
++ GCGraphicsExposures,
+ &gcvalues);
+- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
+ XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
+ XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
+
diff --git a/st.suckless.org/patches/st-alpha-0.5.diff b/st.suckless.org/patches/st-alpha-0.5.diff
new file mode 100644
index 0000000..83cc45a
--- /dev/null
+++ b/st.suckless.org/patches/st-alpha-0.5.diff
_AT_@ -0,0 +1,169 @@
+diff --git a/config.def.h b/config.def.h
+index 58b470e..ce34f55 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -48,6 +48,8 @@ static char termname[] = "st-256color";
+
+ static unsigned int tabspaces = 8;
+
++/* background opacity */
++static const int alpha = 0xdd;
+
+ /* Terminal colors (16 first used in escape sequence) */
+ static const char *colorname[] = {
+_AT_@ -75,6 +77,7 @@ static const char *colorname[] = {
+
+ /* more colors can be added after 255 to use with DefaultXX */
+ "#cccccc",
++ "black",
+ };
+
+
+_AT_@ -83,7 +86,7 @@ static const char *colorname[] = {
+ * foreground, background, cursor
+ */
+ static unsigned int defaultfg = 7;
+-static unsigned int defaultbg = 0;
++static unsigned int defaultbg = 257;
+ static unsigned int defaultcs = 256;
+
+ /*
+diff --git a/config.mk b/config.mk
+index 97afa2c..18aec14 100644
+--- a/config.mk
++++ b/config.mk
+_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
+ INCS = -I. -I/usr/include -I${X11INC} \
+ `pkg-config --cflags fontconfig` \
+ `pkg-config --cflags freetype2`
+-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
++LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lXrender \
+ `pkg-config --libs fontconfig` \
+ `pkg-config --libs freetype2`
+
+diff --git a/st.c b/st.c
+index 392f12d..5b05a5f 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -65,6 +65,7 @@ char *argv0;
+ #define XK_ANY_MOD UINT_MAX
+ #define XK_NO_MOD 0
+ #define XK_SWITCH_MOD (1<<13)
++#define OPAQUE 0Xff
+
+ #define REDRAW_TIMEOUT (80*1000) /* 80 ms */
+
+_AT_@ -79,6 +80,7 @@ char *argv0;
+ #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
+ #define IS_SET(flag) ((term.mode & (flag)) != 0)
+ #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
++#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
+ #define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x))
+
+ #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
+_AT_@ -255,6 +257,7 @@ typedef struct {
+ int w, h; /* window width and height */
+ int ch; /* char height */
+ int cw; /* char width */
++ int depth; /* bit depth */
+ char state; /* focus, redraw, visible */
+ } XWindow;
+
+_AT_@ -2706,8 +2709,7 @@ xresize(int col, int row) {
+ xw.th = MAX(1, row * xw.ch);
+
+ XFreePixmap(xw.dpy, xw.buf);
+- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
++ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
+ XftDrawChange(xw.draw, xw.buf);
+ xclear(0, 0, xw.w, xw.h);
+ }
+_AT_@ -2738,6 +2740,13 @@ xloadcols(void) {
+ }
+ }
+
++ /* set alpha value of bg color */
++ if (USE_ARGB) {
++ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
++ dc.col[defaultbg].pixel &= 0x00111111;
++ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
++ }
++
+ /* load colors [16-255] ; same colors as xterm */
+ for(i = 16, r = 0; r < 6; r++) {
+ for(g = 0; g < 6; g++) {
+_AT_@ -2992,7 +3001,38 @@ xinit(void) {
+ if(!(xw.dpy = XOpenDisplay(NULL)))
+ die("Can't open display
");
+ xw.scr = XDefaultScreen(xw.dpy);
+- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ xw.depth = (USE_ARGB)? 32: XDefaultDepth(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ else {
++ XVisualInfo *vis;
++ XRenderPictFormat *fmt;
++ int nvi;
++ int i;
++
++ XVisualInfo tpl = {
++ .screen = xw.scr,
++ .depth = 32,
++ .class = TrueColor
++ };
++
++ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
++ xw.vis = NULL;
++ for(i = 0; i < nvi; i ++) {
++ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
++ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
++ xw.vis = vis[i].visual;
++ break;
++ }
++ }
++
++ XFree(vis);
++
++ if (! xw.vis) {
++ fprintf(stderr, "Couldn't find ARGB visual.
");
++ exit(1);
++ }
++ }
+
+ /* font */
+ if(!FcInit())
+_AT_@ -3002,7 +3042,10 @@ xinit(void) {
+ xloadfonts(usedfont, 0);
+
+ /* colors */
+- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ else
++ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
+ xloadcols();
+
+ /* adjust fixed window geometry */
+_AT_@ -3036,16 +3079,17 @@ xinit(void) {
+ parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
+ XRootWindow(xw.dpy, xw.scr);
+ xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy,
+- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
++ xw.w, xw.h, 0, xw.depth, InputOutput,
+ xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
+ | CWEventMask | CWColormap, &xw.attrs);
+
+ memset(&gcvalues, 0, sizeof(gcvalues));
+ gcvalues.graphics_exposures = False;
+- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
++ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
++ dc.gc = XCreateGC(xw.dpy,
++ (USE_ARGB)? xw.buf: parent,
++ GCGraphicsExposures,
+ &gcvalues);
+- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
+ XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
+ XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
+
diff --git a/st.suckless.org/patches/st-alpha-0.6.diff b/st.suckless.org/patches/st-alpha-0.6.diff
new file mode 100644
index 0000000..4db4442
--- /dev/null
+++ b/st.suckless.org/patches/st-alpha-0.6.diff
_AT_@ -0,0 +1,170 @@
+diff --git a/config.def.h b/config.def.h
+index 64e75b8..9a27c14 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -58,6 +58,8 @@ static char termname[] = "st-256color";
+
+ static unsigned int tabspaces = 8;
+
++/* bg opacity */
++static const int alpha = 0xdd;
+
+ /* Terminal colors (16 first used in escape sequence) */
+ static const char *colorname[] = {
+_AT_@ -85,6 +87,7 @@ static const char *colorname[] = {
+
+ /* more colors can be added after 255 to use with DefaultXX */
+ "#cccccc",
++ "black",
+ };
+
+
+_AT_@ -93,7 +96,7 @@ static const char *colorname[] = {
+ * foreground, background, cursor
+ */
+ static unsigned int defaultfg = 7;
+-static unsigned int defaultbg = 0;
++static unsigned int defaultbg = 257;
+ static unsigned int defaultcs = 256;
+
+ /*
+diff --git a/config.mk b/config.mk
+index 67844dc..005b1c6 100644
+--- a/config.mk
++++ b/config.mk
+_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
+ INCS = -I. -I/usr/include -I${X11INC} \
+ `pkg-config --cflags fontconfig` \
+ `pkg-config --cflags freetype2`
+-LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft \
++LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft -lXrender\
+ `pkg-config --libs fontconfig` \
+ `pkg-config --libs freetype2`
+
+diff --git a/st.c b/st.c
+index b89d094..d212134 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -61,6 +61,7 @@ char *argv0;
+ #define XK_ANY_MOD UINT_MAX
+ #define XK_NO_MOD 0
+ #define XK_SWITCH_MOD (1<<13)
++#define OPAQUE 0Xff
+
+ /* macros */
+ #define MIN(a, b) ((a) < (b) ? (a) : (b))
+_AT_@ -77,6 +78,7 @@ char *argv0;
+ #define IS_SET(flag) ((term.mode & (flag)) != 0)
+ #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_nsec-t2.tv_nsec)/1E6)
+ #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
++#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
+
+ #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
+ #define IS_TRUECOL(x) (1 << 24 & (x))
+_AT_@ -265,6 +267,7 @@ typedef struct {
+ int w, h; /* window width and height */
+ int ch; /* char height */
+ int cw; /* char width */
++ int depth; /* bit depth */
+ char state; /* focus, redraw, visible */
+ int cursor; /* cursor style */
+ } XWindow;
+_AT_@ -2895,8 +2898,7 @@ xresize(int col, int row) {
+ xw.th = MAX(1, row * xw.ch);
+
+ XFreePixmap(xw.dpy, xw.buf);
+- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
++ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
+ XftDrawChange(xw.draw, xw.buf);
+ xclear(0, 0, xw.w, xw.h);
+ }
+_AT_@ -2946,6 +2948,14 @@ xloadcols(void) {
+ else
+ die("Could not allocate color %d
", i);
+ }
++
++ /* set alpha value of bg color */
++ if (USE_ARGB) {
++ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
++ dc.col[defaultbg].pixel &= 0x00111111;
++ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
++ }
++
+ loaded = true;
+ }
+
+_AT_@ -3189,7 +3199,38 @@ xinit(void) {
+ if(!(xw.dpy = XOpenDisplay(NULL)))
+ die("Can't open display
");
+ xw.scr = XDefaultScreen(xw.dpy);
+- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ else {
++ XVisualInfo *vis;
++ XRenderPictFormat *fmt;
++ int nvi;
++ int i;
++
++ XVisualInfo tpl = {
++ .screen = xw.scr,
++ .depth = 32,
++ .class = TrueColor
++ };
++
++ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
++ xw.vis = NULL;
++ for(i = 0; i < nvi; i ++) {
++ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
++ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
++ xw.vis = vis[i].visual;
++ break;
++ }
++ }
++
++ XFree(vis);
++
++ if (! xw.vis) {
++ fprintf(stderr, "Couldn't find ARGB visual.
");
++ exit(1);
++ }
++ }
+
+ /* font */
+ if(!FcInit())
+_AT_@ -3199,7 +3240,10 @@ xinit(void) {
+ xloadfonts(usedfont, 0);
+
+ /* colors */
+- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ else
++ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
+ xloadcols();
+
+ /* adjust fixed window geometry */
+_AT_@ -3222,16 +3266,17 @@ xinit(void) {
+ if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
+ parent = XRootWindow(xw.dpy, xw.scr);
+ xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
+- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
++ xw.w, xw.h, 0, xw.depth, InputOutput,
+ xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
+ | CWEventMask | CWColormap, &xw.attrs);
+
+ memset(&gcvalues, 0, sizeof(gcvalues));
+ gcvalues.graphics_exposures = False;
+- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
++ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
++ dc.gc = XCreateGC(xw.dpy,
++ (USE_ARGB)? xw.buf: parent,
++ GCGraphicsExposures,
+ &gcvalues);
+- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
+ XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
+ XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
+
diff --git a/st.suckless.org/patches/st-alpha-git-20160617-528241aa.diff b/st.suckless.org/patches/st-alpha-git-20160617-528241aa.diff
new file mode 100644
index 0000000..73d8b03
--- /dev/null
+++ b/st.suckless.org/patches/st-alpha-git-20160617-528241aa.diff
_AT_@ -0,0 +1,188 @@
+diff --git a/config.def.h b/config.def.h
+index 9e61010..2ab4f57 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -67,6 +67,9 @@ static char termname[] = "st-256color";
+
+ static unsigned int tabspaces = 8;
+
++/* bg opacity */
++static const int alpha = 0xdd;
++
+ /* Terminal colors (16 first used in escape sequence) */
+ static const char *colorname[] = {
+ /* 8 normal colors */
+_AT_@ -94,6 +97,7 @@ static const char *colorname[] = {
+ /* more colors can be added after 255 to use with DefaultXX */
+ "#cccccc",
+ "#555555",
++ "black",
+ };
+
+
+_AT_@ -102,7 +106,7 @@ static const char *colorname[] = {
+ * foreground, background, cursor, reverse cursor
+ */
+ static unsigned int defaultfg = 7;
+-static unsigned int defaultbg = 0;
++static unsigned int defaultbg = 257;
+ static unsigned int defaultcs = 256;
+ static unsigned int defaultrcs = 257;
+
+diff --git a/config.mk b/config.mk
+index 81e3e47..005b1c6 100644
+--- a/config.mk
++++ b/config.mk
+_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
+ INCS = -I. -I/usr/include -I${X11INC} \
+ `pkg-config --cflags fontconfig` \
+ `pkg-config --cflags freetype2`
+-LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \
++LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft -lXrender\
+ `pkg-config --libs fontconfig` \
+ `pkg-config --libs freetype2`
+
+diff --git a/st.c b/st.c
+index 2594c65..f9ba75b 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -61,6 +61,7 @@ char *argv0;
+ #define XK_ANY_MOD UINT_MAX
+ #define XK_NO_MOD 0
+ #define XK_SWITCH_MOD (1<<13)
++#define OPAQUE 0Xff
+
+ /* macros */
+ #define MIN(a, b) ((a) < (b) ? (a) : (b))
+_AT_@ -81,6 +82,8 @@ char *argv0;
+ (t1.tv_nsec-t2.tv_nsec)/1E6)
+ #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
+
++#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
++
+ #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
+ #define IS_TRUECOL(x) (1 << 24 & (x))
+ #define TRUERED(x) (((x) & 0xff0000) >> 8)
+_AT_@ -268,6 +271,7 @@ typedef struct {
+ int w, h; /* window width and height */
+ int ch; /* char height */
+ int cw; /* char width */
++ int depth; /* bit depth */
+ char state; /* focus, redraw, visible */
+ int cursor; /* cursor style */
+ } XWindow;
+_AT_@ -3137,7 +3141,7 @@ xresize(int col, int row)
+
+ XFreePixmap(xw.dpy, xw.buf);
+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
++ xw.depth);
+ XftDrawChange(xw.draw, xw.buf);
+ xclear(0, 0, xw.w, xw.h);
+ }
+_AT_@ -3191,6 +3195,14 @@ xloadcols(void)
+ else
+ die("Could not allocate color %d
", i);
+ }
++
++ /* set alpha value of bg color */
++ if (USE_ARGB) {
++ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
++ dc.col[defaultbg].pixel &= 0x00111111;
++ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
++ }
++
+ loaded = 1;
+ }
+
+_AT_@ -3212,6 +3224,16 @@ xsetcolorname(int x, const char *name)
+ return 0;
+ }
+
++void
++xtermclear(int col1, int row1, int col2, int row2) {
++ XftDrawRect(xw.draw,
++ &dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg],
++ borderpx + col1 * xw.cw,
++ borderpx + row1 * xw.ch,
++ (col2-col1+1) * xw.cw,
++ (row2-row1+1) * xw.ch);
++}
++
+ /*
+ * Absolute coordinates.
+ */
+_AT_@ -3443,7 +3465,38 @@ xinit(void)
+ if (!(xw.dpy = XOpenDisplay(NULL)))
+ die("Can't open display
");
+ xw.scr = XDefaultScreen(xw.dpy);
+- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++ else {
++ XVisualInfo *vis;
++ XRenderPictFormat *fmt;
++ int nvi;
++ int i;
++
++ XVisualInfo tpl = {
++ .screen = xw.scr,
++ .depth = 32,
++ .class = TrueColor
++ };
++
++ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
++ xw.vis = NULL;
++ for(i = 0; i < nvi; i ++) {
++ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
++ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
++ xw.vis = vis[i].visual;
++ break;
++ }
++ }
++
++ XFree(vis);
++
++ if (! xw.vis) {
++ fprintf(stderr, "Couldn't find ARGB visual.
");
++ exit(1);
++ }
++ }
+
+ /* font */
+ if (!FcInit())
+_AT_@ -3453,7 +3506,10 @@ xinit(void)
+ xloadfonts(usedfont, 0);
+
+ /* colors */
+- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ if (! USE_ARGB)
++ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
++ else
++ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
+ xloadcols();
+
+ /* adjust fixed window geometry */
+_AT_@ -3476,16 +3532,17 @@ xinit(void)
+ if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
+ parent = XRootWindow(xw.dpy, xw.scr);
+ xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
+- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
++ xw.w, xw.h, 0, xw.depth, InputOutput,
+ xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
+ | CWEventMask | CWColormap, &xw.attrs);
+
+ memset(&gcvalues, 0, sizeof(gcvalues));
+ gcvalues.graphics_exposures = False;
+- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
++ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
++ dc.gc = XCreateGC(xw.dpy,
++ (USE_ARGB)? xw.buf: parent,
++ GCGraphicsExposures,
+ &gcvalues);
+- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
+- DefaultDepth(xw.dpy, xw.scr));
+ XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
+ XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
+
diff --git a/st.suckless.org/patches/st-alpha-s.png b/st.suckless.org/patches/st-alpha-s.png
new file mode 100644
index 0000000..c46ec98
Binary files /dev/null and b/st.suckless.org/patches/st-alpha-s.png differ
diff --git a/st.suckless.org/patches/st-alpha.png b/st.suckless.org/patches/st-alpha.png
new file mode 100644
index 0000000..cbe4be3
Binary files /dev/null and b/st.suckless.org/patches/st-alpha.png differ
diff --git a/st.suckless.org/patches/st-argbbg-0.4.1.diff b/st.suckless.org/patches/st-argbbg-0.4.1.diff
deleted file mode 100644
index fe6b47b..0000000
--- a/st.suckless.org/patches/st-argbbg-0.4.1.diff
+++ /dev/null
_AT_@ -1,171 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index d1c20bd..cc9f34d 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -25,6 +25,8 @@ static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
-
-+/* background opacity */
-+static const int alpha = 0xdd;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-_AT_@ -52,6 +54,7 @@ static const char *colorname[] = {
-
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
-+ "black",
- };
-
-
-_AT_@ -60,7 +63,7 @@ static const char *colorname[] = {
- * foreground, background, cursor
- */
- static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
-+static unsigned int defaultbg = 257;
- static unsigned int defaultcs = 256;
-
- /*
-diff --git a/config.mk b/config.mk
-index 9431de2..0b92bf2 100644
---- a/config.mk
-+++ b/config.mk
-_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
- INCS = -I. -I/usr/include -I${X11INC} \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
-+LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lXrender \
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
-
-diff --git a/st.c b/st.c
-index 686ed5d..de4d0f9 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -60,6 +60,7 @@ char *argv0;
- #define XK_ANY_MOD UINT_MAX
- #define XK_NO_MOD 0
- #define XK_SWITCH_MOD (1<<13)
-+#define OPAQUE 0Xff
-
- #define REDRAW_TIMEOUT (80*1000) /* 80 ms */
-
-_AT_@ -74,6 +75,7 @@ char *argv0;
- #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
- #define IS_SET(flag) ((term.mode & (flag)) != 0)
- #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
-+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
-
- #define VT102ID "[?6c"
-
-_AT_@ -215,6 +217,7 @@ typedef struct {
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
-+ int depth; /* bit depth */
- char state; /* focus, redraw, visible */
- } XWindow;
-
-_AT_@ -2335,8 +2338,7 @@ xresize(int col, int row) {
- xw.th = MAX(1, row * xw.ch);
-
- XFreePixmap(xw.dpy, xw.buf);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
- XftDrawChange(xw.draw, xw.buf);
- xclear(0, 0, xw.w, xw.h);
- }
-_AT_@ -2360,6 +2362,13 @@ xloadcols(void) {
- }
- }
-
-+ /* set alpha value of bg color */
-+ if (USE_ARGB) {
-+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
-+ dc.col[defaultbg].pixel &= 0x00111111;
-+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
-+ }
-+
- /* load colors [16-255] ; same colors as xterm */
- for(i = 16, r = 0; r < 6; r++) {
- for(g = 0; g < 6; g++) {
-_AT_@ -2603,7 +2612,38 @@ xinit(void) {
- if(!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
- xw.scr = XDefaultScreen(xw.dpy);
-- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ xw.depth = (USE_ARGB)? 32: XDefaultDepth(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ else {
-+ XVisualInfo *vis;
-+ XRenderPictFormat *fmt;
-+ int nvi;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = xw.scr,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+
-+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
-+ xw.vis = NULL;
-+ for(i = 0; i < nvi; i ++) {
-+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ xw.vis = vis[i].visual;
-+ break;
-+ }
-+ }
-+
-+ XFree(vis);
-+
-+ if (! xw.vis) {
-+ fprintf(stderr, "Couldn't find ARGB visual.
");
-+ exit(1);
-+ }
-+ }
-
- /* font */
- if(!FcInit())
-_AT_@ -2613,7 +2653,10 @@ xinit(void) {
- xloadfonts(usedfont, 0);
-
- /* colors */
-- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ else
-+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
- xloadcols();
-
- /* adjust fixed window geometry */
-_AT_@ -2647,7 +2690,7 @@ xinit(void) {
- parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
- XRootWindow(xw.dpy, xw.scr);
- xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy,
-- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
-+ xw.w, xw.h, 0, xw.depth, InputOutput,
- xw.vis,
- CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
- | CWColormap,
-_AT_@ -2655,10 +2698,11 @@ xinit(void) {
-
- memset(&gcvalues, 0, sizeof(gcvalues));
- gcvalues.graphics_exposures = False;
-- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
-+ dc.gc = XCreateGC(xw.dpy,
-+ (USE_ARGB)? xw.buf: parent,
-+ GCGraphicsExposures,
- &gcvalues);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
- XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
-
diff --git a/st.suckless.org/patches/st-argbbg-0.5.diff b/st.suckless.org/patches/st-argbbg-0.5.diff
deleted file mode 100644
index 83cc45a..0000000
--- a/st.suckless.org/patches/st-argbbg-0.5.diff
+++ /dev/null
_AT_@ -1,169 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 58b470e..ce34f55 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -48,6 +48,8 @@ static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
-
-+/* background opacity */
-+static const int alpha = 0xdd;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-_AT_@ -75,6 +77,7 @@ static const char *colorname[] = {
-
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
-+ "black",
- };
-
-
-_AT_@ -83,7 +86,7 @@ static const char *colorname[] = {
- * foreground, background, cursor
- */
- static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
-+static unsigned int defaultbg = 257;
- static unsigned int defaultcs = 256;
-
- /*
-diff --git a/config.mk b/config.mk
-index 97afa2c..18aec14 100644
---- a/config.mk
-+++ b/config.mk
-_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
- INCS = -I. -I/usr/include -I${X11INC} \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft \
-+LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil -lXext -lXft -lXrender \
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
-
-diff --git a/st.c b/st.c
-index 392f12d..5b05a5f 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -65,6 +65,7 @@ char *argv0;
- #define XK_ANY_MOD UINT_MAX
- #define XK_NO_MOD 0
- #define XK_SWITCH_MOD (1<<13)
-+#define OPAQUE 0Xff
-
- #define REDRAW_TIMEOUT (80*1000) /* 80 ms */
-
-_AT_@ -79,6 +80,7 @@ char *argv0;
- #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
- #define IS_SET(flag) ((term.mode & (flag)) != 0)
- #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
-+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
- #define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x))
-
- #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
-_AT_@ -255,6 +257,7 @@ typedef struct {
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
-+ int depth; /* bit depth */
- char state; /* focus, redraw, visible */
- } XWindow;
-
-_AT_@ -2706,8 +2709,7 @@ xresize(int col, int row) {
- xw.th = MAX(1, row * xw.ch);
-
- XFreePixmap(xw.dpy, xw.buf);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
- XftDrawChange(xw.draw, xw.buf);
- xclear(0, 0, xw.w, xw.h);
- }
-_AT_@ -2738,6 +2740,13 @@ xloadcols(void) {
- }
- }
-
-+ /* set alpha value of bg color */
-+ if (USE_ARGB) {
-+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
-+ dc.col[defaultbg].pixel &= 0x00111111;
-+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
-+ }
-+
- /* load colors [16-255] ; same colors as xterm */
- for(i = 16, r = 0; r < 6; r++) {
- for(g = 0; g < 6; g++) {
-_AT_@ -2992,7 +3001,38 @@ xinit(void) {
- if(!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
- xw.scr = XDefaultScreen(xw.dpy);
-- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ xw.depth = (USE_ARGB)? 32: XDefaultDepth(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ else {
-+ XVisualInfo *vis;
-+ XRenderPictFormat *fmt;
-+ int nvi;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = xw.scr,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+
-+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
-+ xw.vis = NULL;
-+ for(i = 0; i < nvi; i ++) {
-+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ xw.vis = vis[i].visual;
-+ break;
-+ }
-+ }
-+
-+ XFree(vis);
-+
-+ if (! xw.vis) {
-+ fprintf(stderr, "Couldn't find ARGB visual.
");
-+ exit(1);
-+ }
-+ }
-
- /* font */
- if(!FcInit())
-_AT_@ -3002,7 +3042,10 @@ xinit(void) {
- xloadfonts(usedfont, 0);
-
- /* colors */
-- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ else
-+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
- xloadcols();
-
- /* adjust fixed window geometry */
-_AT_@ -3036,16 +3079,17 @@ xinit(void) {
- parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
- XRootWindow(xw.dpy, xw.scr);
- xw.win = XCreateWindow(xw.dpy, parent, xw.fx, xw.fy,
-- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
-+ xw.w, xw.h, 0, xw.depth, InputOutput,
- xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
- | CWEventMask | CWColormap, &xw.attrs);
-
- memset(&gcvalues, 0, sizeof(gcvalues));
- gcvalues.graphics_exposures = False;
-- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
-+ dc.gc = XCreateGC(xw.dpy,
-+ (USE_ARGB)? xw.buf: parent,
-+ GCGraphicsExposures,
- &gcvalues);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
- XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
-
diff --git a/st.suckless.org/patches/st-argbbg-0.6.diff b/st.suckless.org/patches/st-argbbg-0.6.diff
deleted file mode 100644
index 4db4442..0000000
--- a/st.suckless.org/patches/st-argbbg-0.6.diff
+++ /dev/null
_AT_@ -1,170 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 64e75b8..9a27c14 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -58,6 +58,8 @@ static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
-
-+/* bg opacity */
-+static const int alpha = 0xdd;
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-_AT_@ -85,6 +87,7 @@ static const char *colorname[] = {
-
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
-+ "black",
- };
-
-
-_AT_@ -93,7 +96,7 @@ static const char *colorname[] = {
- * foreground, background, cursor
- */
- static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
-+static unsigned int defaultbg = 257;
- static unsigned int defaultcs = 256;
-
- /*
-diff --git a/config.mk b/config.mk
-index 67844dc..005b1c6 100644
---- a/config.mk
-+++ b/config.mk
-_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
- INCS = -I. -I/usr/include -I${X11INC} \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft \
-+LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft -lXrender\
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
-
-diff --git a/st.c b/st.c
-index b89d094..d212134 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -61,6 +61,7 @@ char *argv0;
- #define XK_ANY_MOD UINT_MAX
- #define XK_NO_MOD 0
- #define XK_SWITCH_MOD (1<<13)
-+#define OPAQUE 0Xff
-
- /* macros */
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
-_AT_@ -77,6 +78,7 @@ char *argv0;
- #define IS_SET(flag) ((term.mode & (flag)) != 0)
- #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_nsec-t2.tv_nsec)/1E6)
- #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
-+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
-
- #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
- #define IS_TRUECOL(x) (1 << 24 & (x))
-_AT_@ -265,6 +267,7 @@ typedef struct {
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
-+ int depth; /* bit depth */
- char state; /* focus, redraw, visible */
- int cursor; /* cursor style */
- } XWindow;
-_AT_@ -2895,8 +2898,7 @@ xresize(int col, int row) {
- xw.th = MAX(1, row * xw.ch);
-
- XFreePixmap(xw.dpy, xw.buf);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
- XftDrawChange(xw.draw, xw.buf);
- xclear(0, 0, xw.w, xw.h);
- }
-_AT_@ -2946,6 +2948,14 @@ xloadcols(void) {
- else
- die("Could not allocate color %d
", i);
- }
-+
-+ /* set alpha value of bg color */
-+ if (USE_ARGB) {
-+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
-+ dc.col[defaultbg].pixel &= 0x00111111;
-+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
-+ }
-+
- loaded = true;
- }
-
-_AT_@ -3189,7 +3199,38 @@ xinit(void) {
- if(!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
- xw.scr = XDefaultScreen(xw.dpy);
-- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ else {
-+ XVisualInfo *vis;
-+ XRenderPictFormat *fmt;
-+ int nvi;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = xw.scr,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+
-+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
-+ xw.vis = NULL;
-+ for(i = 0; i < nvi; i ++) {
-+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ xw.vis = vis[i].visual;
-+ break;
-+ }
-+ }
-+
-+ XFree(vis);
-+
-+ if (! xw.vis) {
-+ fprintf(stderr, "Couldn't find ARGB visual.
");
-+ exit(1);
-+ }
-+ }
-
- /* font */
- if(!FcInit())
-_AT_@ -3199,7 +3240,10 @@ xinit(void) {
- xloadfonts(usedfont, 0);
-
- /* colors */
-- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ else
-+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
- xloadcols();
-
- /* adjust fixed window geometry */
-_AT_@ -3222,16 +3266,17 @@ xinit(void) {
- if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
- parent = XRootWindow(xw.dpy, xw.scr);
- xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
-- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
-+ xw.w, xw.h, 0, xw.depth, InputOutput,
- xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
- | CWEventMask | CWColormap, &xw.attrs);
-
- memset(&gcvalues, 0, sizeof(gcvalues));
- gcvalues.graphics_exposures = False;
-- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
-+ dc.gc = XCreateGC(xw.dpy,
-+ (USE_ARGB)? xw.buf: parent,
-+ GCGraphicsExposures,
- &gcvalues);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
- XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
-
diff --git a/st.suckless.org/patches/st-argbbg-git-20160617-528241aa.diff b/st.suckless.org/patches/st-argbbg-git-20160617-528241aa.diff
deleted file mode 100644
index 73d8b03..0000000
--- a/st.suckless.org/patches/st-argbbg-git-20160617-528241aa.diff
+++ /dev/null
_AT_@ -1,188 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 9e61010..2ab4f57 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -67,6 +67,9 @@ static char termname[] = "st-256color";
-
- static unsigned int tabspaces = 8;
-
-+/* bg opacity */
-+static const int alpha = 0xdd;
-+
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
- /* 8 normal colors */
-_AT_@ -94,6 +97,7 @@ static const char *colorname[] = {
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
- "#555555",
-+ "black",
- };
-
-
-_AT_@ -102,7 +106,7 @@ static const char *colorname[] = {
- * foreground, background, cursor, reverse cursor
- */
- static unsigned int defaultfg = 7;
--static unsigned int defaultbg = 0;
-+static unsigned int defaultbg = 257;
- static unsigned int defaultcs = 256;
- static unsigned int defaultrcs = 257;
-
-diff --git a/config.mk b/config.mk
-index 81e3e47..005b1c6 100644
---- a/config.mk
-+++ b/config.mk
-_AT_@ -14,7 +14,7 @@ X11LIB = /usr/X11R6/lib
- INCS = -I. -I/usr/include -I${X11INC} \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \
-+LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft -lXrender\
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
-
-diff --git a/st.c b/st.c
-index 2594c65..f9ba75b 100644
---- a/st.c
-+++ b/st.c
-_AT_@ -61,6 +61,7 @@ char *argv0;
- #define XK_ANY_MOD UINT_MAX
- #define XK_NO_MOD 0
- #define XK_SWITCH_MOD (1<<13)
-+#define OPAQUE 0Xff
-
- /* macros */
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
-_AT_@ -81,6 +82,8 @@ char *argv0;
- (t1.tv_nsec-t2.tv_nsec)/1E6)
- #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
-
-+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
-+
- #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
- #define IS_TRUECOL(x) (1 << 24 & (x))
- #define TRUERED(x) (((x) & 0xff0000) >> 8)
-_AT_@ -268,6 +271,7 @@ typedef struct {
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
-+ int depth; /* bit depth */
- char state; /* focus, redraw, visible */
- int cursor; /* cursor style */
- } XWindow;
-_AT_@ -3137,7 +3141,7 @@ xresize(int col, int row)
-
- XFreePixmap(xw.dpy, xw.buf);
- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
-+ xw.depth);
- XftDrawChange(xw.draw, xw.buf);
- xclear(0, 0, xw.w, xw.h);
- }
-_AT_@ -3191,6 +3195,14 @@ xloadcols(void)
- else
- die("Could not allocate color %d
", i);
- }
-+
-+ /* set alpha value of bg color */
-+ if (USE_ARGB) {
-+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
-+ dc.col[defaultbg].pixel &= 0x00111111;
-+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
-+ }
-+
- loaded = 1;
- }
-
-_AT_@ -3212,6 +3224,16 @@ xsetcolorname(int x, const char *name)
- return 0;
- }
-
-+void
-+xtermclear(int col1, int row1, int col2, int row2) {
-+ XftDrawRect(xw.draw,
-+ &dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg],
-+ borderpx + col1 * xw.cw,
-+ borderpx + row1 * xw.ch,
-+ (col2-col1+1) * xw.cw,
-+ (row2-row1+1) * xw.ch);
-+}
-+
- /*
- * Absolute coordinates.
- */
-_AT_@ -3443,7 +3465,38 @@ xinit(void)
- if (!(xw.dpy = XOpenDisplay(NULL)))
- die("Can't open display
");
- xw.scr = XDefaultScreen(xw.dpy);
-- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-+ else {
-+ XVisualInfo *vis;
-+ XRenderPictFormat *fmt;
-+ int nvi;
-+ int i;
-+
-+ XVisualInfo tpl = {
-+ .screen = xw.scr,
-+ .depth = 32,
-+ .class = TrueColor
-+ };
-+
-+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
-+ xw.vis = NULL;
-+ for(i = 0; i < nvi; i ++) {
-+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
-+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
-+ xw.vis = vis[i].visual;
-+ break;
-+ }
-+ }
-+
-+ XFree(vis);
-+
-+ if (! xw.vis) {
-+ fprintf(stderr, "Couldn't find ARGB visual.
");
-+ exit(1);
-+ }
-+ }
-
- /* font */
- if (!FcInit())
-_AT_@ -3453,7 +3506,10 @@ xinit(void)
- xloadfonts(usedfont, 0);
-
- /* colors */
-- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ if (! USE_ARGB)
-+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
-+ else
-+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
- xloadcols();
-
- /* adjust fixed window geometry */
-_AT_@ -3476,16 +3532,17 @@ xinit(void)
- if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
- parent = XRootWindow(xw.dpy, xw.scr);
- xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
-- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
-+ xw.w, xw.h, 0, xw.depth, InputOutput,
- xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
- | CWEventMask | CWColormap, &xw.attrs);
-
- memset(&gcvalues, 0, sizeof(gcvalues));
- gcvalues.graphics_exposures = False;
-- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
-+ dc.gc = XCreateGC(xw.dpy,
-+ (USE_ARGB)? xw.buf: parent,
-+ GCGraphicsExposures,
- &gcvalues);
-- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
-- DefaultDepth(xw.dpy, xw.scr));
- XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
- XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
-
diff --git a/st.suckless.org/patches/st-argbbg-s.png b/st.suckless.org/patches/st-argbbg-s.png
deleted file mode 100644
index c46ec98..0000000
Binary files a/st.suckless.org/patches/st-argbbg-s.png and /dev/null differ
diff --git a/st.suckless.org/patches/st-argbbg.png b/st.suckless.org/patches/st-argbbg.png
deleted file mode 100644
index cbe4be3..0000000
Binary files a/st.suckless.org/patches/st-argbbg.png and /dev/null differ
Received on Sat Jun 18 2016 - 19:12:44 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 18 2016 - 19:24:14 CEST