x11: set minimum increment size to 1x1 cells

Depending on the amount of padding, we could previously resize to get a
negative size displayed by the window manager's overlay (e.g., 80x-1 for
a very short window displaying zero terminal lines and only partially
showing the top of the tabs).  We would also like to avoid 80x0 or 0x24
dimensions as these can render funny.  For example, when there is a lot
of padding, an 80x0 size can still show part of the top of the first
line despite it being a cell height of zero.
This commit is contained in:
Jeffrey Knockel authored and Wez Furlong committed 2024-01-24 22:04:16 -07:00
1 parent 0462f318d7
commit b0193850be
1 file changed
+5 -3
+5 -3
View File
@@ -1566,13 +1566,15 @@ impl XWindowInner {
fn set_resize_increments(&mut self, incr: ResizeIncrement) -> anyhow::Result<()> {
use xcb_util::*;
let hints = xcb_size_hints_t {
flags: XCB_ICCCM_SIZE_HINT_P_RESIZE_INC | XCB_ICCCM_SIZE_HINT_BASE_SIZE,
flags: XCB_ICCCM_SIZE_HINT_P_MIN_SIZE
| XCB_ICCCM_SIZE_HINT_P_RESIZE_INC
| XCB_ICCCM_SIZE_HINT_BASE_SIZE,
x: 0,
y: 0,
width: 0,
height: 0,
min_width: 0,
min_height: 0,
min_width: (incr.base_width + incr.x).into(),
min_height: (incr.base_height + incr.y).into(),
max_width: 0,
max_height: 0,
width_inc: incr.x.into(),