Added the single drawable buffer patch as per the FAQ in order to get w3m images to display

This commit is contained in:
bakkeby 2020-06-26 15:01:30 +02:00
parent 93aac7e1a3
commit c8d69b5d70
3 changed files with 20 additions and 0 deletions

View File

@ -15,6 +15,8 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
### Changelog: ### Changelog:
2020-06-26 - Added the single drawable buffer patch as per the FAQ in order to get w3m images to display
2020-06-25 - Upgrade to 0.8.4 (367803, 2020-06-19) 2020-06-25 - Upgrade to 0.8.4 (367803, 2020-06-19)
2020-06-14 - Added w3m patch 2020-06-14 - Added w3m patch

View File

@ -177,6 +177,12 @@
*/ */
#define SCROLLBACK_MOUSE_ALTSCREEN_PATCH 0 #define SCROLLBACK_MOUSE_ALTSCREEN_PATCH 0
/* This is the single drawable buffer patch as outlined in the FAQ to get images
* in w3m to display. While this patch does not break the alpha patch it images
* are not shown in w3m if the alpha patch is applied.
*/
#define SINGLE_DRAWABLE_BUFFER_PATCH 0
/* This patch allows clients to embed into the st window and is useful if you tend to /* This patch allows clients to embed into the st window and is useful if you tend to
* start X applications from the terminal. For example: * start X applications from the terminal. For example:
* *

12
x.c
View File

@ -816,6 +816,7 @@ xresize(int col, int row)
win.tw = col * win.cw; win.tw = col * win.cw;
win.th = row * win.ch; win.th = row * win.ch;
#if !SINGLE_DRAWABLE_BUFFER_PATCH
XFreePixmap(xw.dpy, xw.buf); XFreePixmap(xw.dpy, xw.buf);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
#if ALPHA_PATCH #if ALPHA_PATCH
@ -825,6 +826,7 @@ xresize(int col, int row)
#endif // ALPHA_PATCH #endif // ALPHA_PATCH
); );
XftDrawChange(xw.draw, xw.buf); XftDrawChange(xw.draw, xw.buf);
#endif // SINGLE_DRAWABLE_BUFFER_PATCH
xclear(0, 0, win.w, win.h); xclear(0, 0, win.w, win.h);
/* resize to new width */ /* resize to new width */
@ -1333,13 +1335,21 @@ xinit(int cols, int rows)
gcvalues.graphics_exposures = False; gcvalues.graphics_exposures = False;
#if ALPHA_PATCH #if ALPHA_PATCH
#if SINGLE_DRAWABLE_BUFFER_PATCH
xw.buf = xw.win;
#else
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth); xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth);
#endif // SINGLE_DRAWABLE_BUFFER_PATCH
dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues); dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues);
#else #else
dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
&gcvalues); &gcvalues);
#if SINGLE_DRAWABLE_BUFFER_PATCH
xw.buf = xw.win;
#else
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
DefaultDepth(xw.dpy, xw.scr)); DefaultDepth(xw.dpy, xw.scr));
#endif // SINGLE_DRAWABLE_BUFFER_PATCH
#endif // ALPHA_PATCH #endif // ALPHA_PATCH
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
@ -1999,8 +2009,10 @@ xfinishdraw(void)
if (vbellmode == 3 && win.vbellset) if (vbellmode == 3 && win.vbellset)
xdrawvbell(); xdrawvbell();
#endif // VISUALBELL_3_PATCH #endif // VISUALBELL_3_PATCH
#if !SINGLE_DRAWABLE_BUFFER_PATCH
XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w,
win.h, 0, 0); win.h, 0, 0);
#endif // SINGLE_DRAWABLE_BUFFER_PATCH
XSetForeground(xw.dpy, dc.gc, XSetForeground(xw.dpy, dc.gc,
dc.col[IS_SET(MODE_REVERSE)? dc.col[IS_SET(MODE_REVERSE)?
defaultfg : defaultbg].pixel); defaultfg : defaultbg].pixel);