From 1d72146d2c80dae72317710b924f5a90aa8a89cf Mon Sep 17 00:00:00 2001 From: liwei Date: Fri, 20 Oct 2023 18:39:42 +0800 Subject: [PATCH] fix: linux tray --- .../lib/app/modules/app/controllers/app_controller.dart | 5 ++++- ui/flutter/lib/util/util.dart | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/flutter/lib/app/modules/app/controllers/app_controller.dart b/ui/flutter/lib/app/modules/app/controllers/app_controller.dart index c3ad1ef0d..f0463f91a 100644 --- a/ui/flutter/lib/app/modules/app/controllers/app_controller.dart +++ b/ui/flutter/lib/app/modules/app/controllers/app_controller.dart @@ -202,7 +202,10 @@ class AppController extends GetxController with WindowListener, TrayListener { onClick: (menuItem) => {windowManager.destroy()}, ), ]); - await trayManager.setToolTip('Gopeed'); + if (!Util.isLinux()) { + // Linux seems not support setToolTip, refer to: https://github.com/GopeedLab/gopeed/issues/241 + await trayManager.setToolTip('Gopeed'); + } await trayManager.setContextMenu(menu); trayManager.addListener(this); } diff --git a/ui/flutter/lib/util/util.dart b/ui/flutter/lib/util/util.dart index 17b74870a..247a81f3c 100644 --- a/ui/flutter/lib/util/util.dart +++ b/ui/flutter/lib/util/util.dart @@ -93,6 +93,10 @@ class Util { return !kIsWeb && Platform.isMacOS; } + static isLinux() { + return !kIsWeb && Platform.isLinux; + } + static isWeb() { return kIsWeb; }