1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

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.
This commit is contained in:
Christian Duerr 2022-11-28 02:06:19 +00:00 committed by GitHub
parent d92a8a0e16
commit 19120f40be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View file

@ -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

View file

@ -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.