Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

226_fix_overlayed_closing #231

Merged
merged 4 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions apps/desktop/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ 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;

#[cfg(target_os = "macos")]
use app_handle::AppHandleExt;
use app_handle::AppHandleExt as MacAppHandleExt;

#[cfg(target_os = "macos")]
use window_custom::macos::WebviewWindowExtMacos;
Expand Down Expand Up @@ -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();
}
}
});

Expand Down
Loading