aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/event_loop.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-04-06 13:06:39 +0300
committerGitHub <noreply@github.com>2022-04-06 13:06:39 +0300
commit673710487afac8596a9f18fea9e04aeada32c2be (patch)
tree1305e00422c01e35d91c533b12004c0082528eb4 /alacritty_terminal/src/event_loop.rs
parent851dbc328efd9b212bb2c7b9caaf5763eb4e524b (diff)
downloadr-alacritty-673710487afac8596a9f18fea9e04aeada32c2be.tar.gz
r-alacritty-673710487afac8596a9f18fea9e04aeada32c2be.tar.bz2
r-alacritty-673710487afac8596a9f18fea9e04aeada32c2be.zip
Extract `SizeInfo` from alacritty_terminal
The `SizeInfo` is a SizeInfo used for rendering, which contains information about padding, and such, however all the terminal need is number of visible lines and columns.
Diffstat (limited to 'alacritty_terminal/src/event_loop.rs')
-rw-r--r--alacritty_terminal/src/event_loop.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs
index 113efc1a..3f10f66f 100644
--- a/alacritty_terminal/src/event_loop.rs
+++ b/alacritty_terminal/src/event_loop.rs
@@ -15,9 +15,9 @@ use mio::unix::UnixReady;
use mio::{self, Events, PollOpt, Ready};
use mio_extras::channel::{self, Receiver, Sender};
-use crate::event::{self, Event, EventListener};
+use crate::event::{self, Event, EventListener, WindowSize};
use crate::sync::FairMutex;
-use crate::term::{SizeInfo, Term};
+use crate::term::Term;
use crate::{ansi, thread, tty};
/// Max bytes to read from the PTY before forced terminal synchronization.
@@ -36,7 +36,7 @@ pub enum Msg {
Shutdown,
/// Instruction to resize the PTY.
- Resize(SizeInfo),
+ Resize(WindowSize),
}
/// The main event!.. loop.
@@ -78,8 +78,8 @@ impl event::Notify for Notifier {
}
impl event::OnResize for Notifier {
- fn on_resize(&mut self, size: &SizeInfo) {
- let _ = self.0.send(Msg::Resize(*size));
+ fn on_resize(&mut self, window_size: WindowSize) {
+ let _ = self.0.send(Msg::Resize(window_size));
}
}
@@ -182,7 +182,7 @@ where
while let Ok(msg) = self.rx.try_recv() {
match msg {
Msg::Input(input) => state.write_list.push_back(input),
- Msg::Resize(size) => self.pty.on_resize(&size),
+ Msg::Resize(window_size) => self.pty.on_resize(window_size),
Msg::Shutdown => return false,
}
}