shithub: bar

Download patch

ref: 287d533fb09f017e5c933f0f761ac09428806e6a
parent: 7d13a18d58a4f4ea7857dfec22c1620ce7ab55b9
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Jan 26 09:23:14 EST 2021

resize when window needs expanding, make it current for resizing to work

--- a/bar.c
+++ b/bar.c
@@ -77,7 +77,7 @@
 	w = atoi(a[3]);
 	h = atoi(a[4]);
 
-	if(ow != w || oh != h || owidth != width){
+	if(ow != w || oh != h || owidth < width){
 		if(pos[0] == 't' || pos[1] == 't'){
 			miny = 0;
 			maxy = minheight;
@@ -96,6 +96,7 @@
 			maxx = (w+MAX(100, Borderwidth+Off+width+Off+Borderwidth))/2;
 		}
 		snprint(t, sizeof(t), "resize -r %d %d %d %d", minx, miny, maxx, maxy);
+		write(wctl, "current", 7);
 		if(fprint(wctl, "%s", t) < 0)
 			fprint(2, "%s: %r\n", t);
 		ow = w;