From 88b4dbfc5a890569fcfac3fe400fe0ad0ea234cc Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Mon, 9 Dec 2019 17:26:31 +0000 Subject: [PATCH] Fix minimize causing resize Windows --- CHANGELOG.md | 1 + alacritty/src/event.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb1c00..d4dcc11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Direct escape input on Windows using alt - Incorrect window size on X11 when waking up from suspend - Incorrect width of Unicode 11/12 emojis +- Minimize on windows causing layout issues ## 0.4.0 diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 2c171e2..4cfc215 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -486,6 +486,17 @@ impl Processor { match event { CloseRequested => processor.ctx.terminal.exit(), Resized(lsize) => { + #[cfg(windows)] + { + // Minimizing the window sends a Resize event with zero width and + // height. But there's no need to ever actually resize to this. + // Both WinPTY & ConPTY have issues when resizing down to zero size + // and back. + if lsize.width == 0.0 && lsize.height == 0.0 { + return; + } + } + let psize = lsize.to_physical(processor.ctx.size_info.dpr); processor.ctx.display_update_pending.dimensions = Some(psize); processor.ctx.terminal.dirty = true;