[READ-ONLY] Mirror of https://github.com/probablykasper/remind-me-again. Toggleable cron reminders app for Mac, Linux and Windows
linux macos notifications reminder tauri windows
0

Configure Feed

Select the types of activity you want to include in your feed.

[fix bug] Need to call window.unminimize() on Windows to show the minimized window (#3)

* [fix bug] Need to call window.show() on Windows to display the window.

* [fix bug] Need to call window.show() on Windows to display the window.

* Need to call window.unminimize() on Windows to show the minimized window .

* Unminimize on all platforms

Co-authored-by: TcSnZh <1293969878@qq.com>
Co-authored-by: Kasper <kasperkh.kh@gmail.com>

authored by

bjwktcsnzh
TcSnZh
Kasper
and committed by
GitHub
(Dec 9, 2022, 3:01 AM +0100) 436d26bc 586baa34

+18 -16
+18 -16
src-tauri/src/main.rs
··· 143 143 .on_system_tray_event(|app, event| match event { 144 144 SystemTrayEvent::LeftClick { .. } => { 145 145 let window = match app.get_window("main") { 146 - Some(window) => match window.is_visible().expect("winvis") { 147 - true => { 148 - // hide the window instead of closing due to processes not closing memory leak: https://github.com/tauri-apps/wry/issues/590 149 - window.hide().expect("winhide"); 150 - // window.close().expect("winclose"); 151 - set_is_accessory_policy(true); 152 - return; 153 - } 154 - false => window, 155 - }, 146 + Some(window) => window, 156 147 None => create_window(&app.app_handle()), 157 148 }; 158 - set_is_accessory_policy(false); 159 - std::thread::sleep(std::time::Duration::from_millis(5)); 160 - #[cfg(not(target_os = "macos"))] 161 - { 162 - window.show().unwrap(); 149 + match window.is_visible().expect("Window visible?") { 150 + true => { 151 + // hide the window instead of closing due to processes not closing memory leak: https://github.com/tauri-apps/wry/issues/590 152 + window.hide().expect("Hide window"); 153 + // window.close().expect("winclose"); 154 + set_is_accessory_policy(true); 155 + } 156 + false => { 157 + set_is_accessory_policy(false); 158 + std::thread::sleep(std::time::Duration::from_millis(5)); 159 + #[cfg(not(target_os = "macos"))] 160 + { 161 + window.show().expect("Show window"); 162 + } 163 + window.unminimize().expect("Unminimize window"); 164 + window.set_focus().expect("Focus window"); 165 + } 163 166 } 164 - window.set_focus().unwrap(); 165 167 } 166 168 _ => {} 167 169 })