From f37710ea6999f23cef19ceaaff40726c9702413b Mon Sep 17 00:00:00 2001 From: hoax Date: Sat, 19 Oct 2024 01:47:18 +0530 Subject: [PATCH] fix: focus window on show menu item click --- app/src-tauri/Cargo.lock | 2 +- app/src-tauri/Cargo.toml | 2 +- app/src-tauri/src/tray.rs | 1 + app/src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src-tauri/Cargo.lock b/app/src-tauri/Cargo.lock index 2628672..03f3e0f 100644 --- a/app/src-tauri/Cargo.lock +++ b/app/src-tauri/Cargo.lock @@ -3453,7 +3453,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scribe" -version = "0.5.1" +version = "0.5.2" dependencies = [ "cocoa 0.26.0", "core-graphics 0.24.0", diff --git a/app/src-tauri/Cargo.toml b/app/src-tauri/Cargo.toml index 1ed9bb2..2e556a9 100644 --- a/app/src-tauri/Cargo.toml +++ b/app/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scribe" -version = "0.5.1" +version = "0.5.2" description = "A note taking app with seamless user experience" authors = ["HoaX7"] license = "" diff --git a/app/src-tauri/src/tray.rs b/app/src-tauri/src/tray.rs index f99db17..98cec09 100644 --- a/app/src-tauri/src/tray.rs +++ b/app/src-tauri/src/tray.rs @@ -37,6 +37,7 @@ pub fn make_tray() -> SystemTray { fn show_main_window(app: &AppHandle) -> Window { let window = app.get_window(MAIN_WINDOW_LABEL).unwrap(); window.show().unwrap(); + window.set_focus().unwrap(); window } diff --git a/app/src-tauri/tauri.conf.json b/app/src-tauri/tauri.conf.json index 7da6e7a..6ee6084 100644 --- a/app/src-tauri/tauri.conf.json +++ b/app/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "scribe", - "version": "0.5.1" + "version": "0.5.2" }, "tauri": { "allowlist": {