[wiki] [sites] [st][patch][w3m] new patch: support w3m images || Avi Halachmi (:avih)

From: <git_AT_suckless.org>
Date: Wed, 10 Jun 2020 14:47:48 +0200

commit 8a1768be73b57e595bc5d9a20d7f1a54c55227d2
Author: Avi Halachmi (:avih) <avihpit_AT_yahoo.com>
Date: Wed Jun 10 15:45:44 2020 +0300

    [st][patch][w3m] new patch: support w3m images
    
    This is similar to the patch at the st FAQ in master, but simpler,
    smaller, and without disabling double-buffering in st.

diff --git a/st.suckless.org/patches/w3m/index.md b/st.suckless.org/patches/w3m/index.md
new file mode 100644
index 00000000..afedaf95
--- /dev/null
+++ b/st.suckless.org/patches/w3m/index.md
_AT_@ -0,0 +1,27 @@
+w3m images
+==========
+
+
+Description
+-----------
+Support w3m images hack. Similar to the patch at the FAQ, but it's simpler,
+smaller, and doesn't disable double-buffering in st.
+
+Same as the FAQ patch, the cursor line is deleted at the image, because st
+always renders full lines, even when most of it is empty.
+
+
+Notes:
+------
+* The download is a `git --format-patch` file. It can be applied either with
+ `git am ...`, or with `patch -p1 < ...`.
+
+
+Download
+--------
+[st-w3m-0.8.3.diff](st-w3m-0.8.3.diff)
+
+
+Author
+------
+* Avi Halachmi (:avih) - [https://github.com/avih](https://github.com/avih)
diff --git a/st.suckless.org/patches/w3m/st-w3m-0.8.3.diff b/st.suckless.org/patches/w3m/st-w3m-0.8.3.diff
new file mode 100644
index 00000000..a4e104b4
--- /dev/null
+++ b/st.suckless.org/patches/w3m/st-w3m-0.8.3.diff
_AT_@ -0,0 +1,42 @@
+From 69cffc587b54b0a9cd81adb87abad8e526d5b25b Mon Sep 17 00:00:00 2001
+From: "Avi Halachmi (:avih)" <avihpit_AT_yahoo.com>
+Date: Thu, 4 Jun 2020 17:35:08 +0300
+Subject: [PATCH] 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.
+---
+ x.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/x.c b/x.c
+index e5f1737..b6ae162 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -1594,6 +1594,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);
+ }
+
+
+base-commit: 43a395ae91f7d67ce694e65edeaa7bbc720dd027
+--
+2.17.1
+
Received on Wed Jun 10 2020 - 14:47:48 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 10 2020 - 14:48:45 CEST