refactor: reduce webview lock contention (#6271)

* refactor: replace handle::Handle::get_window() with WindowManager::get_main_window() in multiple files

* refactor: enhance WindowManager to return window state alongside the main window instance

* refactor: update useProfiles and ProfilePage to support profile overrides and improve patchProfilesConfig return type

* refactor: enhance handle_success to check main window existence before notifying profile changes

* refactor: simplify get_main_window_with_state by using pattern matching and improve window state handling

* refactor: fix window activation by removing unnecessary reference in activate_existing_main_window

* refactor: remove redundant macOS conditional for window_manager import
This commit is contained in:
Tunglies
2026-02-07 05:45:15 +00:00
committed by GitHub
parent 6c6e0812b8
commit c30eaa3678
11 changed files with 83 additions and 72 deletions
+1 -2
View File
@@ -264,7 +264,6 @@ pub fn run() {
mod event_handlers {
#[cfg(target_os = "macos")]
use crate::module::lightweight;
#[cfg(target_os = "macos")]
use crate::utils::window_manager::WindowManager;
use crate::{
config::Config,
@@ -316,7 +315,7 @@ pub fn run() {
if let tauri::WindowEvent::CloseRequested { api, .. } = api {
api.prevent_close();
if let Some(window) = core::handle::Handle::get_window() {
if let Some(window) = WindowManager::get_main_window() {
let _ = window.hide();
}
}