Skip to content

Commit

Permalink
Delay window visibility to prevent white background on app launch (#702)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Panek <me@panekj.dev>
  • Loading branch information
Long0x0 and panekj authored Dec 8, 2024
1 parent 439548d commit bd7ba54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ impl ApplicationHandle {
let logical_size = size.map(|size| LogicalSize::new(size.width, size.height));

let mut window_builder = floem_winit::window::WindowBuilder::new()
.with_visible(false)
.with_title(title)
.with_decorations(!undecorated)
.with_transparent(transparent)
Expand Down
3 changes: 3 additions & 0 deletions src/window_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ impl WindowHandle {
}
// Now that the renderer is initialized, draw the first frame
self.render_frame();
if let Some(window) = self.window.as_ref() {
window.set_visible(true);
}
}

pub fn event(&mut self, event: Event) {
Expand Down

0 comments on commit bd7ba54

Please sign in to comment.