[hackers] [st] Fix selection bug || "Roberto E. Vargas Caballero"

From: <hg_AT_suckless.org>
Date: Sun, 16 Sep 2012 12:25:53 +0200 (CEST)

changeset: 307:159fbfc2e12f
tag: tip
user: "Roberto E. Vargas Caballero" <k0ga_AT_shike2.com>
date: Sun Sep 16 10:49:12 2012 +0200
files: st.c
description:
Fix selection bug
After the commit named "Remove timeout in the main loop", selection is not
working in the proper way. After selecting something, press mouse button in
a line outside of selection causes an incorrect highlight. This patch fix
the problem forcing a draw after the press event, but this is only a fast
hack. Real solution means rewriting selection code.
---
 st.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff -r a8fe037b37d1 -r 159fbfc2e12f st.c
--- a/st.c	Sun Sep 16 10:48:38 2012 +0200
+++ b/st.c	Sun Sep 16 10:49:12 2012 +0200
_AT_@ -561,8 +561,11 @@
 	if(IS_SET(MODE_MOUSE))
 		mousereport(e);
 	else if(e->xbutton.button == Button1) {
-		if(sel.bx != -1)
+		if(sel.bx != -1) {
+			sel.bx = -1;
 			tsetdirt(sel.b.y, sel.e.y);
+			draw();
+		}
 		sel.mode = 1;
 		sel.ex = sel.bx = X2COL(e->xbutton.x);
 		sel.ey = sel.by = Y2ROW(e->xbutton.y);
Received on Sun Sep 16 2012 - 12:25:53 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 16 2012 - 12:36:09 CEST