Projects STRLCPY alacritty Commits b77b9b3b
🤬
  • Fix crash when one dimension of the window is zero

    This fixes a crash on Windows when the user resizes the window
    to the point that it has the height of zero. The crash was introduced
    by the glutin update, since it requires non-zero sizes for the
    resize.
  • Loading...
  • Kirill Chibisov committed with GitHub 1 year ago
    b77b9b3b
    1 parent a49bd742
  • ■ ■ ■ ■ ■ ■
    alacritty/src/event.rs
    skipped 1175 lines
    1176 1176   match event {
    1177 1177   WindowEvent::CloseRequested => self.ctx.terminal.exit(),
    1178 1178   WindowEvent::Resized(size) => {
    1179  - // Minimizing the window sends a Resize event with zero width and
    1180  - // height. But there's no need to ever actually resize to this.
    1181  - // ConPTY has issues when resizing down to zero size and back.
    1182  - #[cfg(windows)]
    1183  - if size.width == 0 && size.height == 0 {
     1179 + // Ignore resize events to zero in any dimension, to avoid issues with Winit
     1180 + // and the ConPTY. A 0x0 resize will also occur when the window is minimized
     1181 + // on Windows.
     1182 + if size.width == 0 || size.height == 0 {
    1184 1183   return;
    1185 1184   }
    1186 1185   
    skipped 424 lines
Please wait...
Page is in error, reload to recover