diff --git a/src/gliumwindows.rs b/src/gliumwindows.rs index a5961ec5f..4bbe864e7 100644 --- a/src/gliumwindows.rs +++ b/src/gliumwindows.rs @@ -5,7 +5,7 @@ use clipboard::{Clipboard, ClipboardImpl, Paste}; use failure::Error; use font::FontConfiguration; use glium::{self, glutin}; -use glium::glutin::{ElementState, MouseCursor, WindowId}; +use glium::glutin::{ElementState, MouseCursor}; use opengl::render::Renderer; use opengl::textureatlas::OutOfTextureSpace; use pty::MasterPty; @@ -19,7 +19,6 @@ use term::{MouseButton, MouseEventKind}; use term::KeyCode; use term::KeyModifiers; use term::hyperlink::Hyperlink; -use wakeup::GuiSender; #[derive(Debug, Fail)] pub enum SessionTerminated { @@ -83,8 +82,7 @@ pub struct TerminalWindow { impl TerminalWindow { #[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] pub fn new( - event_loop: &glutin::EventsLoop, - paster: GuiSender, + event_loop: &super::GuiEventLoop, width: u16, height: u16, terminal: Terminal, @@ -108,14 +106,14 @@ impl TerminalWindow { .with_vsync(true) .with_pixel_format(24, 8) .with_srgb(true); - let display = - glium::Display::new(window, context, event_loop).map_err(|e| format_err!("{:?}", e))?; + let display = glium::Display::new(window, context, &*event_loop.event_loop.borrow_mut()) + .map_err(|e| format_err!("{:?}", e))?; let window_id = display.gl_window().id(); let host = Host { display, pty, - clipboard: Clipboard::new(paster, window_id)?, + clipboard: Clipboard::new(event_loop.paster.clone(), window_id)?, }; host.display.gl_window().set_cursor(MouseCursor::Text); diff --git a/src/main.rs b/src/main.rs index fa3fabf16..300919e4e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -100,7 +100,7 @@ struct Windows { /// a remote (running on another thread) mio `Poll` instance, and /// a core for spawning tasks from futures. It acts as the manager /// for various events and is responsible for driving things forward. -struct GuiEventLoop { +pub struct GuiEventLoop { event_loop: RefCell, windows: Rc>, core: futurecore::Core, @@ -459,8 +459,7 @@ fn spawn_window( ); let window = gliumwindows::TerminalWindow::new( - &*event_loop.event_loop.borrow_mut(), - event_loop.paster.clone(), + event_loop, initial_pixel_width, initial_pixel_height, terminal,