Skip to content

Commit 92996a2

Browse files
(i18n-ignore) docs: restore the window if it is minimized (#2823)
Co-authored-by: Tony <[email protected]>
1 parent 7ac0c11 commit 92996a2

File tree

7 files changed

+17
-10
lines changed

7 files changed

+17
-10
lines changed

src/content/docs/es/start/migrate/from-tauri-1.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,9 @@ tauri::Builder::default()
10481048
{
10491049
let app = tray.app_handle();
10501050
if let Some(webview_window) = app.get_webview_window("main") {
1051-
let _ = webview_window.show();
1052-
let _ = webview_window.set_focus();
1051+
let _ = webview_window.unminimize();
1052+
let _ = webview_window.show();
1053+
let _ = webview_window.set_focus();
10531054
}
10541055
}
10551056
})

src/content/docs/fr/start/migrate/from-tauri-1.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,9 @@ tauri::Builder::default()
978978
{
979979
let app = tray.app_handle();
980980
if let Some(webview_window) = app.get_webview_window("main") {
981-
let _ = webview_window.show();
982-
let _ = webview_window.set_focus();
981+
let _ = webview_window.unminimize();
982+
let _ = webview_window.show();
983+
let _ = webview_window.set_focus();
983984
}
984985
}
985986
})

src/content/docs/ja/start/migrate/from-tauri-1.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,9 @@ tauri::Builder::default()
10481048
{
10491049
let app = tray.app_handle();
10501050
if let Some(webview_window) = app.get_webview_window("main") {
1051-
let _ = webview_window.show();
1052-
let _ = webview_window.set_focus();
1051+
let _ = webview_window.unminimize();
1052+
let _ = webview_window.show();
1053+
let _ = webview_window.set_focus();
10531054
}
10541055
}
10551056
})

src/content/docs/learn/system-tray.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ TrayIconBuilder::new()
292292
// in this example, let's show and focus the main window when the tray is clicked
293293
let app = tray.app_handle();
294294
if let Some(window) = app.get_webview_window("main") {
295+
let _ = window.unminimize();
295296
let _ = window.show();
296297
let _ = window.set_focus();
297298
}

src/content/docs/start/migrate/from-tauri-1.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,9 @@ tauri::Builder::default()
10561056
{
10571057
let app = tray.app_handle();
10581058
if let Some(webview_window) = app.get_webview_window("main") {
1059-
let _ = webview_window.show();
1060-
let _ = webview_window.set_focus();
1059+
let _ = webview_window.unminimize();
1060+
let _ = webview_window.show();
1061+
let _ = webview_window.set_focus();
10611062
}
10621063
}
10631064
})

src/content/docs/zh-cn/learn/system-tray.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ TrayIconBuilder::new()
291291
// 在这个例子中,当点击托盘图标时,将展示并聚焦于主窗口
292292
let app = tray.app_handle();
293293
if let Some(window) = app.get_webview_window("main") {
294+
let _ = window.unminimize();
294295
let _ = window.show();
295296
let _ = window.set_focus();
296297
}

src/content/docs/zh-cn/start/migrate/from-tauri-1.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,8 +1049,9 @@ tauri::Builder::default()
10491049
{
10501050
let app = tray.app_handle();
10511051
if let Some(webview_window) = app.get_webview_window("main") {
1052-
let _ = webview_window.show();
1053-
let _ = webview_window.set_focus();
1052+
let _ = webview_window.unminimize();
1053+
let _ = webview_window.show();
1054+
let _ = webview_window.set_focus();
10541055
}
10551056
}
10561057
})

0 commit comments

Comments
 (0)