shithub: riscv

Download patch

ref: 7b8fcd1269d2dd3d71b339b2cf8762549d0610d2
parent: 2dddca984762847a5fca656d62fee1bb5a00541e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Mar 12 19:03:42 EST 2016

libdraw: don't flush in readmouse() when theres nothing to flush

--- a/sys/src/libdraw/mouse.c
+++ b/sys/src/libdraw/mouse.c
@@ -26,8 +26,11 @@
 int
 readmouse(Mousectl *mc)
 {
-	if(mc->image)
-		flushimage(mc->image->display, 1);
+	if(mc->image){
+		Display *d = mc->image->display;
+		if(d->bufp > d->buf)
+			flushimage(d, 1);
+	}
 	if(recv(mc->c, &mc->Mouse) < 0){
 		fprint(2, "readmouse: %r\n");
 		return -1;