diff options
author | Christian Duerr <contact@christianduerr.com> | 2022-11-28 02:06:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 02:06:19 +0000 |
commit | 19120f40be0d2555f984bcadafa0bde8f3df2311 (patch) | |
tree | 3662c6122c4cb76e162050bf8f2cc01ea3552448 | |
parent | d92a8a0e16eda3df7566e5c995aa0d258b6b76f7 (diff) | |
download | alacritty-19120f40be0d2555f984bcadafa0bde8f3df2311.tar.gz alacritty-19120f40be0d2555f984bcadafa0bde8f3df2311.zip |
Fix padding update not updating renderer
This fixes an issue where it was possible to update the padding of the
terminal without actually queueing an update for the renderer
projection, leading to a blurry projection.
Closes #6502.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | alacritty/src/display/mod.rs | 21 |
2 files changed, 13 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ba393d7e..bb37f005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Crash with `OT-SVG` fonts on Linux/BSD - Crash during text compose on old GNOME under Wayland - Mouse cursor staying hidden after window regains focus on macOS Ventura +- Blurry fonts when changing padding size at runtime ## 0.11.0 diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index ed1b1fc5..3e015874 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -620,14 +620,11 @@ impl Display { if let Some(dimensions) = pending_update.dimensions() { width = dimensions.width as f32; height = dimensions.height as f32; - - let renderer_update = self.pending_renderer_update.get_or_insert(Default::default()); - renderer_update.resize = true } let padding = config.window.padding(self.window.scale_factor as f32); - self.size_info = SizeInfo::new( + let mut new_size = SizeInfo::new( width, height, cell_width, @@ -638,16 +635,22 @@ impl Display { ); // Update number of column/lines in the viewport. - let message_bar_lines = - message_buffer.message().map_or(0, |m| m.text(&self.size_info).len()); + let message_bar_lines = message_buffer.message().map_or(0, |m| m.text(&new_size).len()); let search_lines = usize::from(search_active); - self.size_info.reserve_lines(message_bar_lines + search_lines); + new_size.reserve_lines(message_bar_lines + search_lines); // Resize PTY. - pty_resize_handle.on_resize(self.size_info.into()); + pty_resize_handle.on_resize(new_size.into()); // Resize terminal. - terminal.resize(self.size_info); + terminal.resize(new_size); + + // Queue renderer update if terminal dimensions/padding changed. + if new_size != self.size_info { + let renderer_update = self.pending_renderer_update.get_or_insert(Default::default()); + renderer_update.resize = true; + } + self.size_info = new_size; } /// Update the state of the renderer. |