mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
fix(desktop): focus window after update/relaunch (#13701)
This commit is contained in:
parent
985c2a3d15
commit
3aaa34be1e
@ -22,6 +22,8 @@ impl MainWindow {
|
||||
|
||||
pub fn create(app: &AppHandle) -> Result<Self, tauri::Error> {
|
||||
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)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user