mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-11 13:51:01 -05:00
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.
This commit is contained in:
parent
a49bd74292
commit
b77b9b3bcd
1 changed files with 4 additions and 5 deletions
|
@ -1176,11 +1176,10 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
|
||||||
match event {
|
match event {
|
||||||
WindowEvent::CloseRequested => self.ctx.terminal.exit(),
|
WindowEvent::CloseRequested => self.ctx.terminal.exit(),
|
||||||
WindowEvent::Resized(size) => {
|
WindowEvent::Resized(size) => {
|
||||||
// Minimizing the window sends a Resize event with zero width and
|
// Ignore resize events to zero in any dimension, to avoid issues with Winit
|
||||||
// height. But there's no need to ever actually resize to this.
|
// and the ConPTY. A 0x0 resize will also occur when the window is minimized
|
||||||
// ConPTY has issues when resizing down to zero size and back.
|
// on Windows.
|
||||||
#[cfg(windows)]
|
if size.width == 0 || size.height == 0 {
|
||||||
if size.width == 0 && size.height == 0 {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue