mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Call TIOCSWINSZ only on grid change
Instead of calling TIOCSWINSZ for every pixel change it will now be called only on changes to the grid size. This should reduce screen refreshes. This fixes #2177.
This commit is contained in:
parent
5174f9b274
commit
ab8fddd593
2 changed files with 7 additions and 1 deletions
|
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Subprocess spawning on macos
|
- Subprocess spawning on macos
|
||||||
- Unnecessary resize at startup
|
- Unnecessary resize at startup
|
||||||
- Text getting blurry after live-reloading shaders with padding active
|
- Text getting blurry after live-reloading shaders with padding active
|
||||||
|
- Resize events are not send to the shell anymore if dimensions haven't changed
|
||||||
|
|
||||||
## Version 0.3.0
|
## Version 0.3.0
|
||||||
|
|
||||||
|
|
|
@ -388,6 +388,8 @@ impl Display {
|
||||||
let height = psize.height as f32;
|
let height = psize.height as f32;
|
||||||
let cell_width = self.size_info.cell_width;
|
let cell_width = self.size_info.cell_width;
|
||||||
let cell_height = self.size_info.cell_height;
|
let cell_height = self.size_info.cell_height;
|
||||||
|
let previous_cols = self.size_info.cols();
|
||||||
|
let previous_lines = self.size_info.lines();
|
||||||
|
|
||||||
self.size_info.width = width;
|
self.size_info.width = width;
|
||||||
self.size_info.height = height;
|
self.size_info.height = height;
|
||||||
|
@ -412,7 +414,10 @@ impl Display {
|
||||||
if let Some(message) = terminal.message_buffer_mut().message() {
|
if let Some(message) = terminal.message_buffer_mut().message() {
|
||||||
pty_size.height -= pty_size.cell_height * message.text(&size).len() as f32;
|
pty_size.height -= pty_size.cell_height * message.text(&size).len() as f32;
|
||||||
}
|
}
|
||||||
pty_resize_handle.on_resize(&pty_size);
|
|
||||||
|
if previous_cols != size.cols() || previous_lines != size.lines() {
|
||||||
|
pty_resize_handle.on_resize(&pty_size);
|
||||||
|
}
|
||||||
|
|
||||||
self.window.resize(psize);
|
self.window.resize(psize);
|
||||||
self.renderer.resize(psize, self.size_info.padding_x, self.size_info.padding_y);
|
self.renderer.resize(psize, self.size_info.padding_x, self.size_info.padding_y);
|
||||||
|
|
Loading…
Reference in a new issue