mirror of
https://github.com/servo/servo.git
synced 2025-08-26 15:48:22 +01:00
bugfix: servoshell: prevent 0 pixel dimensions for render area (#35967)
Signed-off-by: Sebastian C <sebsebmc@gmail.com>
This commit is contained in:
parent
86957be5f0
commit
99d4baa533
1 changed files with 7 additions and 0 deletions
|
@ -87,6 +87,7 @@ impl Window {
|
|||
.with_decorations(!no_native_titlebar)
|
||||
.with_transparent(no_native_titlebar)
|
||||
.with_inner_size(LogicalSize::new(window_size.width, window_size.height))
|
||||
.with_min_inner_size(LogicalSize::new(1, 1))
|
||||
.with_visible(true);
|
||||
|
||||
#[allow(deprecated)]
|
||||
|
@ -691,6 +692,12 @@ impl WindowPortsMethods for Window {
|
|||
|
||||
fn set_toolbar_height(&self, height: Length<f32, DeviceIndependentPixel>) {
|
||||
self.toolbar_height.set(height);
|
||||
// Prevent the inner area from being 0 pixels wide or tall
|
||||
// this prevents a crash in the compositor due to invalid surface size
|
||||
self.winit_window.set_min_inner_size(Some(PhysicalSize::new(
|
||||
1.0,
|
||||
1.0 + (self.toolbar_height() * self.hidpi_factor()).0,
|
||||
)));
|
||||
}
|
||||
|
||||
fn rendering_context(&self) -> Rc<dyn RenderingContext> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue