shithub: bar

Download patch

ref: f637e7de9dc3c1bb8e90590ab2956fe9d86a2d02
parent: 788b43acc54ce8cc74681750f708c9044bfa2b72
parent:
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Nov 25 05:33:23 EST 2020

fix vertical resizing

--- a/bar.c	Fri Nov 20 06:38:29 2020
+++ b/bar.c	Wed Nov 25 05:33:23 2020
@@ -71,9 +71,9 @@
 	if(ow != w || oh != h){
 		if(pos[0] == 't' || pos[1] == 't'){
 			miny = 0;
-			maxy = 3*f->height;
+			maxy = Borderwidth+3*f->height+Borderwidth;
 		}else{
-			miny = h - 3*f->height;
+			miny = h - (Borderwidth+3*f->height+Borderwidth);
 			maxy = h;
 		}
 		if(pos[0] == 'l' || pos[1] == 'l'){
@@ -83,7 +83,9 @@
 			minx = MAX(100, w-(Borderwidth+Off+width+Off+Borderwidth));
 			maxx = w;
 		}
-		fprint(wctl, "resize -r %d %d %d %d", minx, miny, maxx, maxy);
+		snprint(t, sizeof(t), "resize -r %d %d %d %d", minx, miny, maxx, maxy);
+		if(fprint(wctl, "%s", t) < 0)
+			fprint(2, "%s: %r\n", t);
 		ow = w;
 		oh = h;
 	}