aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty/src')
-rw-r--r--alacritty/src/event.rs7
-rw-r--r--alacritty/src/main.rs23
2 files changed, 4 insertions, 26 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 4cfc2152..4b1fe892 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -308,20 +308,18 @@ pub struct Processor<N> {
suppress_chars: bool,
modifiers: ModifiersState,
config: Config,
- pty_resize_handle: Box<dyn OnResize>,
message_buffer: MessageBuffer,
display: Display,
font_size: Size,
}
-impl<N: Notify> Processor<N> {
+impl<N: Notify + OnResize> Processor<N> {
/// Create a new event processor
///
/// Takes a writer which is expected to be hooked up to the write end of a
/// pty.
pub fn new(
notifier: N,
- pty_resize_handle: Box<dyn OnResize>,
message_buffer: MessageBuffer,
config: Config,
display: Display,
@@ -334,7 +332,6 @@ impl<N: Notify> Processor<N> {
modifiers: Default::default(),
font_size: config.font.size,
config,
- pty_resize_handle,
message_buffer,
display,
}
@@ -405,7 +402,7 @@ impl<N: Notify> Processor<N> {
if !display_update_pending.is_empty() {
self.display.handle_update(
&mut terminal,
- self.pty_resize_handle.as_mut(),
+ &mut self.notifier,
&self.message_buffer,
&self.config,
display_update_pending,
diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs
index 9b5b8eb8..64e0b9cf 100644
--- a/alacritty/src/main.rs
+++ b/alacritty/src/main.rs
@@ -27,8 +27,6 @@ use std::env;
use std::error::Error;
use std::fs;
use std::io::{self, Write};
-#[cfg(not(windows))]
-use std::os::unix::io::AsRawFd;
use std::sync::Arc;
#[cfg(target_os = "macos")]
@@ -170,16 +168,6 @@ fn run(window_event_loop: GlutinEventLoop<Event>, config: Config) -> Result<(),
#[cfg(any(target_os = "macos", windows))]
let pty = tty::new(&config, &display.size_info, None);
- // Create PTY resize handle
- //
- // This exists because rust doesn't know the interface is thread-safe
- // and we need to be able to resize the PTY from the main thread while the IO
- // thread owns the EventedRW object.
- #[cfg(windows)]
- let resize_handle = pty.resize_handle();
- #[cfg(not(windows))]
- let resize_handle = pty.fd.as_raw_fd();
-
// Create the pseudoterminal I/O loop
//
// pty I/O is ran on another thread as to not occupy cycles used by the
@@ -204,15 +192,8 @@ fn run(window_event_loop: GlutinEventLoop<Event>, config: Config) -> Result<(),
let message_buffer = MessageBuffer::new();
// Event processor
- //
- // Need the Rc<RefCell<_>> here since a ref is shared in the resize callback
- let mut processor = Processor::new(
- event_loop::Notifier(loop_tx.clone()),
- Box::new(resize_handle),
- message_buffer,
- config,
- display,
- );
+ let mut processor =
+ Processor::new(event_loop::Notifier(loop_tx.clone()), message_buffer, config, display);
// Kick off the I/O thread
let io_thread = event_loop.spawn();