Skip to content

Commit

Permalink
Wait to display window until initialization is complete (alacritty#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-l authored and jwilm committed Nov 19, 2017
1 parent a9753c3 commit a931d69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/display.rs
Expand Up @@ -197,6 +197,9 @@ impl Display {
api.clear(background_color);
});

// Show the window now that it's been initialized
window.show();

Ok(Display {
window: window,
renderer: renderer,
Expand Down
7 changes: 6 additions & 1 deletion src/window.rs
Expand Up @@ -190,7 +190,8 @@ impl Window {
Window::platform_window_init();
let window = WindowBuilder::new()
.with_title(title)
.with_transparency(true);
.with_transparency(true)
.with_visibility(false);
let context = ContextBuilder::new()
.with_vsync(true);
let window = ::glutin::GlWindow::new(window, context, &event_loop)?;
Expand Down Expand Up @@ -266,6 +267,10 @@ impl Window {
self.window.resize(width, height);
}

pub fn show(&self) {
self.window.show();
}

/// Block waiting for events
#[inline]
pub fn wait_events<F>(&mut self, func: F)
Expand Down

0 comments on commit a931d69

Please sign in to comment.