Skip to content

Commit

Permalink
Merge pull request #274 from alley-rs/0.1.X
Browse files Browse the repository at this point in the history
fix: Show and focus main window on startup to prevent white screen flash
  • Loading branch information
thep0y authored Nov 12, 2024
2 parents 86c47a9 + 902cfde commit d4e4587
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ fn is_linux() -> bool {
/// 防止启动时闪白屏
#[tauri::command]
async fn show_main_window(app: AppHandle) {
debug!("Showing main window");
debug!("Showing and focusing main window");

let main_window = app.get_window("main").unwrap();

main_window.show().unwrap();
main_window.set_focus().unwrap();
}

#[tokio::main]
Expand Down

0 comments on commit d4e4587

Please sign in to comment.