code: drawterm

Download patch

ref: 4d482dfbd85fd0e4311d14566cbc6b49240e7b95
parent: 375b0049f0549cd584cae8b1f4ea2d5453fb907e
author: Jacob Moody <moody@posixcafe.org>
date: Tue Oct 12 05:20:45 EDT 2021

wayland: ensure we grab the drawlock for writes to the frame buffer.

--- a/gui-wl/wl-screen.c
+++ b/gui-wl/wl-screen.c
@@ -114,11 +114,12 @@
 	gscreen->r = r;
 	rectclip(&(gscreen->clipr), gscreen->r);
 
-	wldrawcursor(wl, &arrow);
 	wl->runing = 1;
 	kproc("wldispatch", dispatchproc, wl);
 	terminit();
+	qlock(&drawlock);
 	wlflush(wl);
+	qunlock(&drawlock);
 	return wl;
 }
 
@@ -169,7 +170,9 @@
 void
 setcursor(void)
 {
-	wldrawcursor(snarfwin, &cursor);
+	qlock(&drawlock);
+	wldrawcursor(snarfwin, &arrow);
+	qunlock(&drawlock);
 }
 
 void