shithub: drawterm

Download patch

ref: dbee61922549014f2d0dae877d1dc25ed946d710
parent: 5e5cd80755ea4c164eae70d876a3f9b864fe742e
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Wed Jan 19 20:50:53 EST 2022

gui-wl: mark surface damaged only in areas that changed

--- a/gui-wl/wl-inc.h
+++ b/gui-wl/wl-inc.h
@@ -41,6 +41,7 @@
 	int mony;
 	Mouse mouse;
 	Clipboard clip;
+	Rectangle r;
 	int dirty;
 
 	/* Wayland State */
--- a/gui-wl/wl-screen.c
+++ b/gui-wl/wl-screen.c
@@ -52,7 +52,7 @@
 
 	wl_surface_attach(wl->surface, wl->screenbuffer, 0, 0);
 	if(wl->dirty)
-		wl_surface_damage(wl->surface, 0, 0, wl->dx, wl->dy);
+		wl_surface_damage(wl->surface, wl->r.min.x, wl->r.min.y, Dx(wl->r), Dy(wl->r));
 	wl_surface_commit(wl->surface);
 	wl->dirty = 0;
 }
@@ -76,6 +76,7 @@
 
 	qlock(&drawlock);
 	wl->dirty = 1;
+	wl->r = r;
 	wlflush(wl);
 	qunlock(&drawlock);
 }
@@ -154,6 +155,7 @@
 
 	wl = gwin;
 	wl->dirty = 1;
+	wl->r = r;
 	wlflush(wl);
 }
 
@@ -161,6 +163,7 @@
 screensize(Rectangle r, ulong chan)
 {
 	gwin->dirty = 1;
+	gwin->r = r;
 }
 
 void