diff options
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r-- | alacritty/src/event.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index bfadbaec..cd4f82a1 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -12,7 +12,7 @@ use std::time::Instant; use glutin::dpi::PhysicalSize; use glutin::event::{ElementState, Event as GlutinEvent, ModifiersState, MouseButton, WindowEvent}; -use glutin::event_loop::{ControlFlow, EventLoop, EventLoopProxy}; +use glutin::event_loop::{ControlFlow, EventLoop, EventLoopProxy, EventLoopWindowTarget}; use glutin::platform::desktop::EventLoopExtDesktop; use log::{debug, info, warn}; use serde_json as json; @@ -67,6 +67,7 @@ pub struct ActionContext<'a, N, T> { pub message_buffer: &'a mut MessageBuffer, pub display_update_pending: &'a mut DisplayUpdate, pub config: &'a mut Config, + pub event_loop: &'a EventLoopWindowTarget<Event>, font_size: &'a mut Size, } @@ -249,6 +250,10 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon fn config(&self) -> &Config { self.config } + + fn event_loop(&self) -> &EventLoopWindowTarget<Event> { + self.event_loop + } } pub enum ClickState { @@ -346,7 +351,7 @@ impl<N: Notify + OnResize> Processor<N> { { let mut event_queue = Vec::new(); - event_loop.run_return(|event, _event_loop, control_flow| { + event_loop.run_return(|event, event_loop, control_flow| { if self.config.debug.print_events { info!("glutin event: {:?}", event); } @@ -407,6 +412,7 @@ impl<N: Notify + OnResize> Processor<N> { window: &mut self.display.window, font_size: &mut self.font_size, config: &mut self.config, + event_loop, }; let mut processor = input::Processor::new(context, &self.display.urls, &self.display.highlighted_url); |