diff options
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r-- | alacritty/src/event.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 0e9ab655..f3fbc699 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -928,7 +928,6 @@ pub struct Processor<N> { mouse: Mouse, received_count: usize, suppress_chars: bool, - clipboard: Clipboard, modifiers: ModifiersState, config: Config, message_buffer: MessageBuffer, @@ -951,11 +950,6 @@ impl<N: Notify + OnResize> Processor<N> { display: Display, cli_options: CLIOptions, ) -> Processor<N> { - #[cfg(not(any(target_os = "macos", windows)))] - let clipboard = Clipboard::new(display.window.wayland_display()); - #[cfg(any(target_os = "macos", windows))] - let clipboard = Clipboard::new(); - Processor { notifier, mouse: Default::default(), @@ -967,7 +961,6 @@ impl<N: Notify + OnResize> Processor<N> { message_buffer, display, event_queue: Vec::new(), - clipboard, search_state: SearchState::new(), cli_options, dirty: false, @@ -1012,6 +1005,12 @@ impl<N: Notify + OnResize> Processor<N> { self.event_queue.push(event.into()); } + // NOTE: Since this takes a pointer to the winit event loop, it MUST be dropped first. + #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] + let mut clipboard = unsafe { Clipboard::new(event_loop.wayland_display()) }; + #[cfg(any(not(feature = "wayland"), target_os = "macos", windows))] + let mut clipboard = Clipboard::new(); + event_loop.run_return(|event, event_loop, control_flow| { if self.config.ui_config.debug.print_events { info!("glutin event: {:?}", event); @@ -1067,7 +1066,7 @@ impl<N: Notify + OnResize> Processor<N> { terminal: &mut terminal, notifier: &mut self.notifier, mouse: &mut self.mouse, - clipboard: &mut self.clipboard, + clipboard: &mut clipboard, received_count: &mut self.received_count, suppress_chars: &mut self.suppress_chars, modifiers: &mut self.modifiers, |