diff --git a/src/frontend/glium/window.rs b/src/frontend/glium/window.rs index 47be0e3f1..621218624 100644 --- a/src/frontend/glium/window.rs +++ b/src/frontend/glium/window.rs @@ -178,6 +178,13 @@ impl TerminalWindow for GliumTerminalWindow { .ok_or_else(|| format_err!("failed to get inner window size"))?; let dpi_scale = self.host.display.gl_window().get_hidpi_factor(); let (width, height): (u32, u32) = size.to_physical(dpi_scale).into(); + + if width == 0 || height == 0 { + // on windows, this can happen when minimizing the window. + // NOP! + return Ok(()); + } + debug!( "resize {}x{}@{} -> {}x{}@{}", self.width, self.height, old_dpi_scale, width, height, dpi_scale diff --git a/src/frontend/software/termwindow.rs b/src/frontend/software/termwindow.rs index 7dbb48b45..d1e657539 100644 --- a/src/frontend/software/termwindow.rs +++ b/src/frontend/software/termwindow.rs @@ -738,6 +738,11 @@ impl WindowCallbacks for TermWindow { } fn resize(&mut self, dimensions: Dimensions) { + if dimensions.pixel_width == 0 || dimensions.pixel_height == 0 { + // on windows, this can happen when minimizing the window. + // NOP! + return; + } self.scaling_changed(dimensions, self.fonts.get_font_scale()); }