diff options
author | Canop <cano.petrole@gmail.com> | 2021-11-19 18:10:01 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-11-19 18:10:01 +0100 |
commit | 8c6f8f2b803a1ffc8d27b94e14bc4246a1680cb2 (patch) | |
tree | a0fa59e402f2d3823d8af2e45b3a0d5e295e1226 /src/app | |
parent | 69f09cf2521996439e2387803bf6a12977139feb (diff) |
fix some graphical glitches on Windows
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/app.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/app/app.rs b/src/app/app.rs index f25f777..9bae1fa 100644 --- a/src/app/app.rs +++ b/src/app/app.rs @@ -713,6 +713,7 @@ impl App { self.do_pending_tasks(w, &skin, &mut dam, &mut app_state, con)?, ); } + #[allow(unused_mut)] match dam.next(&self.rx_seqs) { Either::First(Some(event)) => { info!("event: {:?}", &event); @@ -725,8 +726,15 @@ impl App { self.active_panel_idx = self.clicked_panel_index(x, y); handled = true; } - } else if let Event::Resize(w, h) = event.event { - self.screen.set_terminal_size(w, h, con); + } else if let Event::Resize(mut width, mut height) = event.event { + // I don't know why but Crossterm seems to always report an + // understimated size on Windows + #[cfg(windows)] + { + width += 1; + height += 1; + } + self.screen.set_terminal_size(width, height, con); Areas::resize_all( self.panels.as_mut_slice(), self.screen, |