shithub: zuke

Download patch

ref: 504011b50809153ffd3d22d9da036e42f2fcdc37
parent: 61bf5454dff9f50a2e2867f77737439d29a80ed4
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Dec 9 06:46:44 EST 2019

use (un)lockdisplay

--- a/zuke.c
+++ b/zuke.c
@@ -112,6 +112,7 @@
 	if(entering)
 		return;
 
+	lockdisplay(display);
 	if(new && getwindow(display, Refnone) < 0)
 		sysfatal("getwindow: %r");
 	else
@@ -226,6 +227,7 @@
 	}
 
 	flushimage(display, 1);
+	unlockdisplay(display);
 }
 
 static void
@@ -290,7 +292,7 @@
 	close(p[1]);
 
 	if(pid > 0){
-		newcover = readimage(display, p[0], 0);
+		newcover = readimage(display, p[0], 1);
 		sendp(ch, newcover);
 	}
 	close(p[0]);
@@ -696,8 +698,9 @@
 		sysfatal("empty");
 	}
 
-	if(initdraw(0, 0, "zuke") < 0)
+	if(initdraw(nil, nil, "zuke") < 0)
 		sysfatal("initdraw: %r");
+	unlockdisplay(display);
 	if((mctl = initmouse(nil, screen)) == nil)
 		sysfatal("initmouse: %r");
 	if((kctl = initkeyboard(nil)) == nil)