Skip to content

Commit 3aaa34b

Browse files
authored
fix(desktop): focus window after update/relaunch (#13701)
1 parent 985c2a3 commit 3aaa34b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/desktop/src-tauri/src/windows.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ impl MainWindow {
2222

2323
pub fn create(app: &AppHandle) -> Result<Self, tauri::Error> {
2424
if let Some(window) = app.get_webview_window(Self::LABEL) {
25+
let _ = window.set_focus();
26+
let _ = window.unminimize();
2527
return Ok(Self(window));
2628
}
2729

@@ -50,6 +52,9 @@ impl MainWindow {
5052

5153
let window = window_builder.build()?;
5254

55+
// Ensure window is focused after creation (e.g., after update/relaunch)
56+
let _ = window.set_focus();
57+
5358
setup_window_state_listener(app, &window);
5459

5560
#[cfg(windows)]

0 commit comments

Comments
 (0)