shithub: zuke

Download patch

ref: 5be6d6790c5de9fa2272eec3e1fb346e7c6130be
parent: b4f44fb55211c0445e3b55080082ee92d569e354
author: Sigrid Haflínudóttir <[email protected]>
date: Mon Aug 24 10:32:20 EDT 2020

add a few yields in redraw to reduce sound crackle with slow drawing

--- a/zuke.c
+++ b/zuke.c
@@ -175,6 +175,7 @@
 
 	if(full){
 		draw(screen, screen->r, colors[Dback].im, nil, ZP);
+		yield();
 
 		adjustcolumns();
 		if(scrollsz < plnum){ /* scrollbar */
@@ -208,6 +209,7 @@
 		sp.x = sp.y = 0;
 		p.x = left + 2;
 		p.y = screen->r.min.y + 2;
+		yield();
 
 		for(i = scroll; i < plnum; i++, p.y += f->height){
 			if(i < 0)
@@ -246,6 +248,7 @@
 				leftp.y = rightp.y = p.y + f->height;
 				line(screen, leftp, rightp, 0, 0, 0, colors[Dflow].im, sp);
 			}
+			yield();
 		}
 	}
 
@@ -279,6 +282,7 @@
 	p = addpt(Pt(right, r.min.y), Pt(2, 2));
 	string(screen, p, colors[Dfhigh].im, sp, f, tmp);
 	sel = r;
+	yield();
 
 	if(cover != nil && full){
 		r.max.x = r.min.x;