From 2ce302c89c10b0a68e5fc2d11b1c17ee57dbc104 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 3 Feb 2024 20:06:55 -0700 Subject: [PATCH] wayland: don't try to resize a hidden frame it causes a panic. refs: https://github.com/wez/wezterm/issues/4948 --- window/src/os/wayland/window.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/window/src/os/wayland/window.rs b/window/src/os/wayland/window.rs index c45a0fe5560..5ff517eb6d2 100644 --- a/window/src/os/wayland/window.rs +++ b/window/src/os/wayland/window.rs @@ -244,12 +244,14 @@ impl WaylandWindow { true }; window_frame.set_hidden(hidden); - window_frame.resize( - NonZeroU32::new(dimensions.pixel_width as u32) - .ok_or_else(|| anyhow!("dimensions {dimensions:?} are invalid"))?, - NonZeroU32::new(dimensions.pixel_height as u32) - .ok_or_else(|| anyhow!("dimensions {dimensions:?} are invalid"))?, - ); + if !hidden { + window_frame.resize( + NonZeroU32::new(dimensions.pixel_width as u32) + .ok_or_else(|| anyhow!("dimensions {dimensions:?} are invalid"))?, + NonZeroU32::new(dimensions.pixel_height as u32) + .ok_or_else(|| anyhow!("dimensions {dimensions:?} are invalid"))?, + ); + } window.set_min_size(Some((32, 32))); let (w, h) = window_frame.add_borders(