commit d85ba1891ed49d8f0f90527eb8f7cef16dce64a0
parent 3c9c84a7bf7812b305bf4dbe56bfe67b8a6d6353
Author: endiexz <endiexz@163.com>
Date: Wed, 28 Aug 2024 13:39:57 +0800
This patch removes the outlined rectangle when a st window is unfocused
Diffstat:
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/st.suckless.org/patches/unfocused_cursor/index.md b/st.suckless.org/patches/unfocused_cursor/index.md
@@ -0,0 +1,13 @@
+## unfocused-cursor
+
+## Description
+
+By default, when an st window is unfocused, the cursor appears as an outlined rectangle. If you prefer a cleaner look, this patch removes the outlined rectangle, making the cursor invisible when the window is unfocused.
+
+## Download
+
+* [st-unfocused-cursor-0.1.diff](st-unfocused-cursor-0.1.diff)
+
+## Author
+
+* Endiexz [endiexz.top](endiexz.top)
+\ No newline at end of file
diff --git a/st.suckless.org/patches/unfocused_cursor/st-unfocused-cursor-0.1.diff b/st.suckless.org/patches/unfocused_cursor/st-unfocused-cursor-0.1.diff
@@ -0,0 +1,21 @@
+diff --git a/x.c b/x.c
+index d19bb3f..c9f2057 100644
+--- a/x.c
++++ b/x.c
+@@ -1618,7 +1618,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
+ break;
+ }
+ } else {
+- XftDrawRect(xw.draw, &drawcol,
++/* XftDrawRect(xw.draw, &drawcol,
+ win.hborderpx + cx * win.cw,
+ win.vborderpx + cy * win.ch,
+ win.cw - 1, 1);
+@@ -1634,6 +1634,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
+ win.hborderpx + cx * win.cw,
+ win.vborderpx + (cy + 1) * win.ch - 1,
+ win.cw, 1);
++*/
+ }
+ }
+