diff options
author | Wolfgang Müller | 2021-06-17 16:58:00 +0200 |
---|---|---|
committer | Wolfgang Müller | 2021-06-18 10:59:48 +0200 |
commit | c49fbfba5e527677f8d5221f31f08a0732e148c3 (patch) | |
tree | ca12cbe5b78fd4224472cfd175ab3205bdeebbdd | |
parent | 0774a46257bdc6daa1c6a1c3485d75bd07ef849c (diff) | |
download | weltschmerz-c49fbfba5e527677f8d5221f31f08a0732e148c3.tar.gz |
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
Diffstat (limited to '')
-rw-r--r-- | terminal.vala | 11 |
1 files 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); |