aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-12-29 15:30:30 -0500
committerJoe Wilm <joe@jwilm.com>2016-12-29 15:34:33 -0500
commitd06360216d3f10a0d42f576e6a859de88436a7d6 (patch)
tree0799bf3654f3b4caa816102ae6985cdf51794321 /src/main.rs
parent689e0f4ad784390c39ed614358f14a722be7dc17 (diff)
downloadr-alacritty-d06360216d3f10a0d42f576e6a859de88436a7d6.tar.gz
r-alacritty-d06360216d3f10a0d42f576e6a859de88436a7d6.tar.bz2
r-alacritty-d06360216d3f10a0d42f576e6a859de88436a7d6.zip
Hopefully fix read not triggering draw
The terminal mutex is no longer released between event processing and doing a draw. This may fix the race condition with data arriving but not being displayed until a subsequent event. cc #29
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index fb58b461..aa2da104 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -104,10 +104,10 @@ fn run(mut config: Config, options: cli::Options) -> Result<(), Box<Error>> {
// Need the Rc<RefCell<_>> here since a ref is shared in the resize callback
let mut processor = event::Processor::new(
event_loop::Notifier(loop_tx),
- terminal.clone(),
display.resize_channel(),
&config,
options.ref_test,
+ display.size().to_owned(),
);
// Create a config monitor when config was loaded from path
@@ -123,7 +123,7 @@ fn run(mut config: Config, options: cli::Options) -> Result<(), Box<Error>> {
// Main display loop
loop {
// Process input and window events
- let wakeup_request = processor.process_events(display.window());
+ let (mut terminal, wakeup_request) = processor.process_events(&terminal, display.window());
// Handle config reloads
let config_updated = config_monitor.as_ref()
@@ -136,7 +136,6 @@ fn run(mut config: Config, options: cli::Options) -> Result<(), Box<Error>> {
}).unwrap_or(false);
// Maybe draw the terminal
- let mut terminal = terminal.lock();
if wakeup_request || config_updated {
// Handle pending resize events
//