This part looks especially ugly, effectively uses XftDrawRect to draw
lines, so I suggest to rewrite it this way.

---
 st.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/st.c b/st.c
index c5d62c1..32e4c55 100644
--- a/st.c
+++ b/st.c
@@ -3908,22 +3908,11 @@ xdrawcursor(void)
                        break;
                }
        } else {
-               XftDrawRect(xw.draw, &drawcol,
-                               borderpx + curx * xw.cw,
-                               borderpx + term.c.y * xw.ch,
-                               xw.cw - 1, 1);
-               XftDrawRect(xw.draw, &drawcol,
-                               borderpx + curx * xw.cw,
-                               borderpx + term.c.y * xw.ch,
-                               1, xw.ch - 1);
-               XftDrawRect(xw.draw, &drawcol,
-                               borderpx + (curx + 1) * xw.cw - 1,
-                               borderpx + term.c.y * xw.ch,
-                               1, xw.ch - 1);
-               XftDrawRect(xw.draw, &drawcol,
-                               borderpx + curx * xw.cw,
-                               borderpx + (term.c.y + 1) * xw.ch - 1,
-                               xw.cw, 1);
+               XSetForeground(xw.dpy, dc.gc, drawcol.pixel);
+               XDrawRectangle(xw.dpy, xw.buf, dc.gc,
+                              borderpx + curx * xw.cw,
+                              borderpx + term.c.y * xw.ch,
+                              xw.cw - 1, xw.ch - 1);
        }
        oldx = curx, oldy = term.c.y;
 }
-- 
2.4.10


Reply via email to