shithub: riscv

Download patch

ref: 4fcc5efce5481064c4abc483a103fbaad3fb0875
parent: c31c4ca7b37ae113e9df810f03157c2fe7bb2708
author: cinap_lenrek <[email protected]>
date: Tue Apr 16 14:52:49 EDT 2013

mouse: fix cursor redraw to prevent screen blanking (thanks erik)

--- a/sys/src/9/port/devmouse.c
+++ b/sys/src/9/port/devmouse.c
@@ -517,6 +517,9 @@
 static void
 mouseproc(void*)
 {
+	ulong counter;
+
+	counter = ~0;
 	while(waserror())
 		;
 	for(;;){
@@ -524,10 +527,11 @@
 			mouse.redraw = 0;
 			cursoroff();
 			cursoron();
-			drawactive(1);
-		} else {
-			drawactive(0);
 		}
+
+		drawactive(mouse.counter != counter);
+		counter = mouse.counter;
+
 		tsleep(&mouse.redrawr, shouldredraw, 0, 20*1000);
 	}
 }