summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-02-10 23:42:33 +0300
committerGitHub <noreply@github.com>2022-02-10 23:42:33 +0300
commit933030efd45016e5a357ff6a271d38ee423e9395 (patch)
tree8044a5a14f6248e8bebfe766ff68ccceefac464e
parentc35ccaf9b542cc90d3a37f123fe6cb429ad9157c (diff)
downloadalacritty-933030efd45016e5a357ff6a271d38ee423e9395.tar.gz
alacritty-933030efd45016e5a357ff6a271d38ee423e9395.zip
Fix terminal not being damage when only font size changed
If font size changes however the cells stay the same the terminal won't be damaged, since it wasn't resized, however the visual change happened, thus the entire screen should be damaged.
-rw-r--r--alacritty/src/display/mod.rs24
1 files changed, 17 insertions, 7 deletions
diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs
index d4d1a91b..7a694278 100644
--- a/alacritty/src/display/mod.rs
+++ b/alacritty/src/display/mod.rs
@@ -490,6 +490,21 @@ impl Display {
info!("Padding: {} x {}", self.size_info.padding_x(), self.size_info.padding_y());
info!("Width: {}, Height: {}", self.size_info.width(), self.size_info.height());
+
+ // Damage the entire screen after processing update.
+ self.fully_damage();
+ }
+
+ /// Damage the entire window.
+ fn fully_damage(&mut self) {
+ let screen_rect = DamageRect {
+ x: 0,
+ y: 0,
+ width: self.size_info.width() as u32,
+ height: self.size_info.height() as u32,
+ };
+
+ self.damage_rects.push(screen_rect);
}
fn update_damage<T: EventListener>(
@@ -506,15 +521,10 @@ impl Display {
}
self.damage_highlighted_hints(terminal);
- let size_info: SizeInfo<u32> = self.size_info.into();
match terminal.damage(selection_range) {
- TermDamage::Full => {
- let screen_rect =
- DamageRect { x: 0, y: 0, width: size_info.width(), height: size_info.height() };
- self.damage_rects.push(screen_rect);
- },
+ TermDamage::Full => self.fully_damage(),
TermDamage::Partial(damaged_lines) => {
- let damaged_rects = RenderDamageIterator::new(damaged_lines, size_info);
+ let damaged_rects = RenderDamageIterator::new(damaged_lines, self.size_info.into());
for damaged_rect in damaged_rects {
self.damage_rects.push(damaged_rect);
}