From 1ed8b1d0c1499969ea74996608320ed6ad787541 Mon Sep 17 00:00:00 2001 From: Texas0295 Date: Fri, 12 Sep 2025 13:26:15 +0800 Subject: [PATCH] [FIX] tray: ensure Show Window works reliably on Linux/Wayland MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid relying on appWindow.isVisible, which is not trustworthy under bitsdojo on Linux/Wayland. Instead, always run show → restore → show sequence to guarantee window is re-mapped and raised. Signed-off-by: Texas0295 --- lib/screens/tray_manager.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/screens/tray_manager.dart b/lib/screens/tray_manager.dart index ef38de5f..5f03e40b 100644 --- a/lib/screens/tray_manager.dart +++ b/lib/screens/tray_manager.dart @@ -48,11 +48,12 @@ class TrayService { void handleAction(MenuItem item) { switch (item.key) { case 'show_window': - if (appWindow.isVisible) { - appWindow.restore(); - } else { - appWindow.show(); - } + () async { + appWindow.show(); + appWindow.restore(); + await Future.delayed(const Duration(milliseconds: 32)); + appWindow.show(); + }(); break; case 'exit_app': appWindow.close();