fix(tray): restore window properly from tray menu

Add unminimize() call to show_hide menu handler to match left-click
behavior. Also add logging for debugging visibility state.
This commit is contained in:
vicrodh committed 2026-01-23 16:49:33 -06:00
1 parent 4aa76a0ed4
commit e86734c9a7
1 file changed
+6 -1
+6 -1
View File
@@ -104,10 +104,15 @@ pub fn init_tray(app: &AppHandle) -> Result<(), Box<dyn std::error::Error>> {
}
"show_hide" => {
if let Some(window) = app.get_webview_window("main") {
if window.is_visible().unwrap_or(true) {
let is_visible = window.is_visible().unwrap_or(false);
log::info!("Show/Hide: window visible = {}", is_visible);
if is_visible {
log::info!("Hiding window");
let _ = window.hide();
} else {
log::info!("Showing window");
let _ = window.show();
let _ = window.unminimize();
let _ = window.set_focus();
}
}