From c49fbfba5e527677f8d5221f31f08a0732e148c3 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Thu, 17 Jun 2021 16:58:00 +0200 Subject: Set minimum width and height in window geometry weltschmerz currently does not indicate any minimum size for its window geometry. If the minimum size is not set, GtkWindow uses its requisition as the minimum size [1]. Make sure, instead, that we control this value and set it to one cell. [1] https://valadoc.org/gdk-3.0/Gdk.Geometry.html --- terminal.vala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/terminal.vala b/terminal.vala index 3fcdea6..6c99cac 100644 --- a/terminal.vala +++ b/terminal.vala @@ -83,14 +83,19 @@ class Terminal : Gtk.Overlay { vte.set_allow_hyperlink(conf.allow_hyperlinks); vte.set_font(conf.font); + + var char_width = (int)vte.get_char_width(); + var char_height = (int)vte.get_char_height(); var geometry = Gdk.Geometry() { // This must be kept in sync with the padding size in terminal.css base_width = 2 * 2, base_height = 2 * 2, - width_inc = (int)vte.get_char_width(), - height_inc = (int)vte.get_char_height() + min_width = char_width, + min_height = char_height, + width_inc = char_width, + height_inc = char_height, }; - window.set_geometry_hints(null, geometry, BASE_SIZE | RESIZE_INC); + window.set_geometry_hints(null, geometry, BASE_SIZE | RESIZE_INC | MIN_SIZE); vte.set_mouse_autohide(conf.autohide_mouse); vte.set_scrollback_lines(conf.scrollback); -- cgit v1.2.3-2-gb3c3