From 845a6432b7486ae023440f7367120741fbe3dde2 Mon Sep 17 00:00:00 2001 From: Neyl-123 <97339070+Neyl-123@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:00:58 +0100 Subject: [PATCH 1/4] 226_fix_overlayed_closing See Issue #226 in upstream repo --- apps/desktop/src-tauri/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs index 8911c88f..301097e1 100644 --- a/apps/desktop/src-tauri/src/main.rs +++ b/apps/desktop/src-tauri/src/main.rs @@ -179,7 +179,12 @@ fn main() { win.hide().unwrap(); } - api.prevent_close(); + if label == MAIN_WINDOW_NAME { + app.save_window_state(StateFlags::POSITION | StateFlags::SIZE); + std::process::exit(0); + } else { + api.prevent_close(); + } } }); From 30e0020cd629faa26dbd51115c6319614e4f5852 Mon Sep 17 00:00:00 2001 From: Neyl-123 <97339070+Neyl-123@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:54:05 +0100 Subject: [PATCH 2/4] Added Import for AppHandleExt --- apps/desktop/src-tauri/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs index 301097e1..1e401be2 100644 --- a/apps/desktop/src-tauri/src/main.rs +++ b/apps/desktop/src-tauri/src/main.rs @@ -22,7 +22,7 @@ use std::{ }; use tauri::{generate_handler, menu::Menu, LogicalSize, Manager, Wry}; use tauri_plugin_log::{Target, TargetKind}; -use tauri_plugin_window_state::StateFlags; +use tauri_plugin_window_state::{AppHandleExt, StateFlags}; use tray::Tray; use window_custom::WebviewWindowExt; From 20c55bcf1389fc1ad2b434f7819be6e8f0c33a34 Mon Sep 17 00:00:00 2001 From: Neyl-123 <97339070+Neyl-123@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:37:17 +0100 Subject: [PATCH 3/4] Removed AppHandle --- apps/desktop/src-tauri/src/main.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs index 1e401be2..b68af885 100644 --- a/apps/desktop/src-tauri/src/main.rs +++ b/apps/desktop/src-tauri/src/main.rs @@ -26,9 +26,6 @@ use tauri_plugin_window_state::{AppHandleExt, StateFlags}; use tray::Tray; use window_custom::WebviewWindowExt; -#[cfg(target_os = "macos")] -use app_handle::AppHandleExt; - #[cfg(target_os = "macos")] use window_custom::macos::WebviewWindowExtMacos; From 9c1606405e04b5543c15a0950f2af147e5f447c6 Mon Sep 17 00:00:00 2001 From: Neyl-123 <97339070+Neyl-123@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:33:35 +0100 Subject: [PATCH 4/4] Renamed the AppHandleExt for macos --- apps/desktop/src-tauri/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs index b68af885..8f844c23 100644 --- a/apps/desktop/src-tauri/src/main.rs +++ b/apps/desktop/src-tauri/src/main.rs @@ -26,6 +26,9 @@ use tauri_plugin_window_state::{AppHandleExt, StateFlags}; use tray::Tray; use window_custom::WebviewWindowExt; +#[cfg(target_os = "macos")] +use app_handle::AppHandleExt as MacAppHandleExt; + #[cfg(target_os = "macos")] use window_custom::macos::WebviewWindowExtMacos;