Skip to content

Commit

Permalink
wayland: don't try to resize a hidden frame
Browse files Browse the repository at this point in the history
it causes a panic.

refs: #4948
  • Loading branch information
wez committed Feb 4, 2024
1 parent 050aa07 commit 2ce302c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions window/src/os/wayland/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2ce302c

Please sign in to comment.