[dev] [PATCH st] Make DECSCUSR thickness configurable

From: Omar Sandoval <osandov_AT_osandov.com>
Date: Thu, 9 Apr 2015 18:22:31 -0700

---
 config.def.h |  5 +++++
 st.c         | 12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/config.def.h b/config.def.h
index 56bae2d..5e7caaf 100644
--- a/config.def.h
+++ b/config.def.h
_AT_@ -42,6 +42,11 @@ static unsigned int actionfps = 30;
 static unsigned int blinktimeout = 800;
 
 /*
+ * thickness of underline and bar cursors
+ */
+static unsigned int cursorthickness = 2;
+
+/*
  * bell volume. It must be a value between -100 and 100. Use 0 for disabling
  * it
  */
diff --git a/st.c b/st.c
index 6d20977..094a6d3 100644
--- a/st.c
+++ b/st.c
_AT_@ -3578,7 +3578,7 @@ xdrawcursor(void) {
 
 	/* draw the new one */
 	if(xw.state & WIN_FOCUSED) {
-		switch (xw.cursor) {
+		switch(xw.cursor) {
 			case 0: /* Blinking Block */
 			case 1: /* Blinking Block (Default) */
 			case 2: /* Steady Block */
_AT_@ -3597,15 +3597,15 @@ xdrawcursor(void) {
 			case 4: /* Steady Underline */
 				XftDrawRect(xw.draw, &dc.col[defaultcs],
 						borderpx + curx * xw.cw,
-						borderpx + (term.c.y + 1) * xw.ch - 1,
-						xw.cw, 1);
+						borderpx + (term.c.y + 1) * xw.ch - cursorthickness,
+						xw.cw, cursorthickness);
 				break;
 			case 5: /* Blinking bar */
 			case 6: /* Steady bar */
 				XftDrawRect(xw.draw, &dc.col[defaultcs],
-								borderpx + curx * xw.cw,
-								borderpx + term.c.y * xw.ch,
-								1, xw.ch);
+						borderpx + curx * xw.cw,
+						borderpx + term.c.y * xw.ch,
+						cursorthickness, xw.ch);
 				break;
 		}
 	} else {
-- 
2.3.5
Received on Fri Apr 10 2015 - 03:22:31 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 10 2015 - 03:24:08 CEST