From 4fcc5efce5481064c4abc483a103fbaad3fb0875 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 16 Apr 2013 18:52:49 +0200 Subject: [PATCH] mouse: fix cursor redraw to prevent screen blanking (thanks erik) --- sys/src/9/port/devmouse.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/src/9/port/devmouse.c b/sys/src/9/port/devmouse.c index 04a921145..c16ed0b60 100644 --- a/sys/src/9/port/devmouse.c +++ b/sys/src/9/port/devmouse.c @@ -517,6 +517,9 @@ shouldredraw(void*) static void mouseproc(void*) { + ulong counter; + + counter = ~0; while(waserror()) ; for(;;){ @@ -524,10 +527,11 @@ mouseproc(void*) mouse.redraw = 0; cursoroff(); cursoron(); - drawactive(1); - } else { - drawactive(0); } + + drawactive(mouse.counter != counter); + counter = mouse.counter; + tsleep(&mouse.redrawr, shouldredraw, 0, 20*1000); } }