🐛 Fix windows tray issue

This commit is contained in:
2025-02-24 21:59:41 +08:00
parent 9e039cc532
commit 566ebde1dd
3 changed files with 23 additions and 31 deletions

View File

@ -369,7 +369,7 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
if (kIsWeb || Platform.isAndroid || Platform.isIOS) return;
await localNotifier.setup(
appName: 'solian',
appName: 'Solian',
shortcutPolicy: ShortcutPolicy.requireCreate,
);
}
@ -429,7 +429,11 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
break;
case 'exit':
_appLifecycleListener?.dispose();
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
if (Platform.isWindows) {
appWindow.close();
} else {
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
}
break;
}
}