diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-01-15 16:19:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 16:19:32 +0000 |
commit | 2b5de00241465a77b90d48b9a140e3ce5e531ff4 (patch) | |
tree | 70f0981ab8282eafd265809388335ae1cb3072f3 | |
parent | 8aa8422bccdf0634774ddbfe5b35e05a637a3f17 (diff) | |
download | alacritty-2b5de00241465a77b90d48b9a140e3ce5e531ff4.tar.gz alacritty-2b5de00241465a77b90d48b9a140e3ce5e531ff4.zip |
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.
-rw-r--r-- | src/window.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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); |