1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 13:52:55 +03:00

wayland: improve error check

This avoids a nasty panic, and shows some more context,
but doesn't really fix anything.

refs: https://github.com/wez/wezterm/issues/4948
This commit is contained in:
Wez Furlong 2024-02-03 20:00:22 -07:00
parent 281a0ce4da
commit 050aa078d7
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -245,8 +245,10 @@ impl WaylandWindow {
};
window_frame.set_hidden(hidden);
window_frame.resize(
NonZeroU32::new(dimensions.pixel_width as u32).unwrap(),
NonZeroU32::new(dimensions.pixel_height as u32).unwrap(),
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)));