From e2b88c093a0bf0a39b5c8ac39c1c4573f16b9f8c Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Mon, 18 Jun 2012 20:59:26 +0200 Subject: [PATCH] Add minimum size for terminal At the moment the terminal can a negativ size and resizing it can create some artifacts. --- clients/terminal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clients/terminal.c b/clients/terminal.c index 43088751..7e1c741d 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -772,6 +772,12 @@ resize_handler(struct widget *widget, struct terminal *terminal = data; int32_t columns, rows, m; + if (width < 200) + width = 200; + + if (height < 50) + height = 50; + m = 2 * terminal->margin; columns = (width - m) / (int32_t) terminal->extents.max_x_advance; rows = (height - m) / (int32_t) terminal->extents.height;