From 2b5de00241465a77b90d48b9a140e3ce5e531ff4 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Mon, 15 Jan 2018 16:19:32 +0000 Subject: Spawn alacritty window as invisible This change initially spawns alacritty as in invisible window, this makes it possible for the pty to already access data like `window_id` without having to wait for the window manager to actually open the window. Even though `GlWindow::new` is blocking when `with_visibility(true)` is used, the `window.show` call is not blocking. So calling `GlWindow::new` and `with_visibility(false)`, then immediately calling `window.show` will create a window and make it visible instantly. --- src/window.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/window.rs') diff --git a/src/window.rs b/src/window.rs index aec4b76d..55b7cd55 100644 --- a/src/window.rs +++ b/src/window.rs @@ -196,11 +196,13 @@ impl Window { Window::platform_window_init(); let window = WindowBuilder::new() .with_title(title) + .with_visibility(false) .with_transparency(true) .with_decorations(window_config.decorations()); let context = ContextBuilder::new() .with_vsync(true); let window = ::glutin::GlWindow::new(window, context, &event_loop)?; + window.show(); // Text cursor window.set_cursor(GlutinMouseCursor::Text); -- cgit v1.2.3-54-g00ecf