1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

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.
This commit is contained in:
Christian Duerr 2018-01-15 16:19:32 +00:00 committed by GitHub
parent 8aa8422bcc
commit 2b5de00241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);