From 729eef0c933831bccfeac6a355bdb410787fbe5f Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 5 Oct 2019 02:29:26 +0200 Subject: Update to winit/glutin EventLoop 2.0 This takes the latest glutin master to port Alacritty to the EventLoop 2.0 rework. This changes a big part of the event loop handling by pushing the event loop in a separate thread from the renderer and running both in parallel. Fixes #2796. Fixes #2694. Fixes #2643. Fixes #2625. Fixes #2618. Fixes #2601. Fixes #2564. Fixes #2456. Fixes #2438. Fixes #2334. Fixes #2254. Fixes #2217. Fixes #1789. Fixes #1750. Fixes #1125. --- alacritty_terminal/src/ansi.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'alacritty_terminal/src/ansi.rs') diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 3bdef32d..b34c1cd9 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -16,11 +16,13 @@ use std::io; use std::str; -use crate::index::{Column, Contains, Line}; use base64; -use glutin::MouseCursor; +use log::{debug, trace}; +use serde::{Deserialize, Serialize}; + use vte; +use crate::index::{Column, Contains, Line}; use crate::term::color::Rgb; // Parse colors in XParseColor format @@ -104,7 +106,7 @@ struct ProcessorState { /// Processor creates a Performer when running advance and passes the Performer /// to `vte::Parser`. struct Performer<'a, H: Handler + TermInfo, W: io::Write> { - _state: &'a mut ProcessorState, + state: &'a mut ProcessorState, handler: &'a mut H, writer: &'a mut W, } @@ -117,7 +119,7 @@ impl<'a, H: Handler + TermInfo + 'a, W: io::Write> Performer<'a, H, W> { handler: &'b mut H, writer: &'b mut W, ) -> Performer<'b, H, W> { - Performer { _state: state, handler, writer } + Performer { state, handler, writer } } } @@ -157,9 +159,6 @@ pub trait Handler { /// OSC to set window title fn set_title(&mut self, _: &str) {} - /// Set the window's mouse cursor - fn set_mouse_cursor(&mut self, _: MouseCursor) {} - /// Set the cursor style fn set_cursor_style(&mut self, _: Option) {} @@ -686,7 +685,7 @@ where #[inline] fn print(&mut self, c: char) { self.handler.input(c); - self._state.preceding_char = Some(c); + self.state.preceding_char = Some(c); } #[inline] @@ -919,7 +918,7 @@ where handler.move_up(Line(arg_or_default!(idx: 0, default: 1) as usize)); }, ('b', None) => { - if let Some(c) = self._state.preceding_char { + if let Some(c) = self.state.preceding_char { for _ in 0..arg_or_default!(idx: 0, default: 1) { handler.input(c); } -- cgit v1.2.3-54-g00ecf