From 1c1493e3cd7bf363165faf328aaad5b3cc040ba6 Mon Sep 17 00:00:00 2001 From: Clawdbot Date: Sun, 15 Feb 2026 09:14:26 +0100 Subject: [PATCH] fix(desktop): focus window after update/relaunch When the app relaunches after an update, the window would remain hidden in the Dock instead of being focused and brought to the foreground. This fix ensures set_focus() is called: 1. When creating a new main window 2. When returning an existing window (early return path) Fixes #13700 --- packages/desktop/src-tauri/src/windows.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/desktop/src-tauri/src/windows.rs b/packages/desktop/src-tauri/src/windows.rs index 2ddcb0506d8f..056720055b55 100644 --- a/packages/desktop/src-tauri/src/windows.rs +++ b/packages/desktop/src-tauri/src/windows.rs @@ -22,6 +22,8 @@ impl MainWindow { pub fn create(app: &AppHandle) -> Result { if let Some(window) = app.get_webview_window(Self::LABEL) { + let _ = window.set_focus(); + let _ = window.unminimize(); return Ok(Self(window)); } @@ -50,6 +52,9 @@ impl MainWindow { let window = window_builder.build()?; + // Ensure window is focused after creation (e.g., after update/relaunch) + let _ = window.set_focus(); + setup_window_state_listener(app, &window); #[cfg(windows)]