aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2020-06-04 17:35:08 +0300
committerlonkaars <loek@pipeframe.xyz>2022-12-24 10:56:27 +0100
commit3d763919f55a8554c1f945ef6e83d74d2a3a0e60 (patch)
treefc71ff9fb778b47165a71a3b2a8bb8aa0469722a
parent05fc2768c0bd0401e1ef2cd483317c4c3640eb8f (diff)
support w3m images
w3m images are a hack which renders on top of the terminal's drawable, which didn't work in st because when using double buffering, the front buffer (on which w3m draws its images) is ignored, and st draws only on the back buffer, which is then copied to the front buffer. There's a patch to make it work at the FAQ already, but that patch canceles double-buffering, which can have negative side effects on some cases such as flickering. This patch achieves the same goal but instead of canceling the double buffer it first copies the front buffer to the back buffer. This has the same issues as the FAQ patch in that the cursor line is deleted at the image (because st renders always full lines), but otherwise it's simpler and does keeps double buffering.
-rw-r--r--x.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/x.c b/x.c
index f778b3f..e973acf 100644
--- a/x.c
+++ b/x.c
@@ -1738,6 +1738,8 @@ xsettitle(char *p)
int
xstartdraw(void)
{
+ if (IS_SET(MODE_VISIBLE))
+ XCopyArea(xw.dpy, xw.win, xw.buf, dc.gc, 0, 0, win.w, win.h, 0, 0);
return IS_SET(MODE_VISIBLE);
}