From b0193850be3d124fbd61d84ec6df1777315616c8 Mon Sep 17 00:00:00 2001 From: Jeffrey Knockel Date: Tue, 23 Jan 2024 18:40:49 -0500 Subject: [PATCH] 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. --- window/src/os/x11/window.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/window/src/os/x11/window.rs b/window/src/os/x11/window.rs index af51a26a0..6e4aca541 100644 --- a/window/src/os/x11/window.rs +++ b/window/src/os/x11/window.rs @@ -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(),