[hackers] [[st][PATCH]] Set minimum window size during initialization. Currently the terminal crashes without window bounds. This also makes it consistent with behaviour of other terminals that don't allow resizing below the cursor width

From: <michaelbuch12_AT_gmail.com>
Date: Wed, 16 May 2018 20:38:04 +0100

From: Michael Buch <michaelbuch12_AT_gmail.com>

---
 x.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/x.c b/x.c
index c0bd890..00ea444 100644
--- a/x.c
+++ b/x.c
_AT_@ -788,15 +788,17 @@ xhints(void)
 
 	sizeh = XAllocSizeHints();
 
-	sizeh->flags = PSize | PResizeInc | PBaseSize;
+	sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize;
 	sizeh->height = win.h;
 	sizeh->width = win.w;
 	sizeh->height_inc = win.ch;
 	sizeh->width_inc = win.cw;
 	sizeh->base_height = 2 * borderpx;
 	sizeh->base_width = 2 * borderpx;
+	sizeh->min_height = 2 * win.ch;
+	sizeh->min_width = 2 * win.cw;
 	if (xw.isfixed) {
-		sizeh->flags |= PMaxSize | PMinSize;
+		sizeh->flags |= PMaxSize;
 		sizeh->min_width = sizeh->max_width = win.w;
 		sizeh->min_height = sizeh->max_height = win.h;
 	}
-- 
2.17.0
Received on Wed May 16 2018 - 21:38:04 CEST

This archive was generated by hypermail 2.3.0 : Wed May 16 2018 - 21:48:24 CEST