remove flutter tray

This commit is contained in:
rustdesk 2022-12-01 11:19:51 +08:00
parent 1f4d45edaf
commit ac33924a9c
3 changed files with 4 additions and 70 deletions

View File

@ -14,11 +14,8 @@ import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart';
import 'package:flutter_hbb/models/platform_model.dart';
import 'package:flutter_hbb/models/server_model.dart';
import 'package:flutter_hbb/utils/multi_window_manager.dart';
import 'package:flutter_hbb/utils/tray_manager.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:tray_manager/tray_manager.dart';
import 'package:window_manager/window_manager.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:window_size/window_size.dart' as window_size;
@ -34,7 +31,7 @@ class DesktopHomePage extends StatefulWidget {
const borderColor = Color(0xFF2F65BA);
class _DesktopHomePageState extends State<DesktopHomePage>
with TrayListener, AutomaticKeepAliveClientMixin {
with AutomaticKeepAliveClientMixin {
final _leftPaneScrollController = ScrollController();
@override
@ -428,35 +425,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
);
}
@override
void onTrayIconMouseDown() {
windowManager.show();
}
@override
void onTrayIconRightMouseDown() {
// linux does not support popup menu manually.
// linux will handle popup action ifself.
if (Platform.isMacOS || Platform.isWindows) {
trayManager.popUpContextMenu();
}
}
@override
void onTrayMenuItemClick(MenuItem menuItem) {
switch (menuItem.key) {
case kTrayItemQuitKey:
windowManager.close();
break;
case kTrayItemShowKey:
windowManager.show();
windowManager.focus();
break;
default:
break;
}
}
@override
void initState() {
super.initState();
@ -492,9 +460,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
}
});
Get.put<RxBool>(svcStopped, tag: 'stop-service');
// disable this tray because we use tray function provided by rust now
// initTray();
trayManager.addListener(this);
rustDeskWinManager.registerActiveWindowListener(onActiveWindowChanged);
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
@ -536,10 +501,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
@override
void dispose() {
// destoryTray();
// fix: disable unregister to prevent from receiving events from other windows
// rustDeskWinManager.unregisterActiveWindowListener(onActiveWindowChanged);
trayManager.removeListener(this);
_uniLinksSubscription?.cancel();
Get.delete<RxBool>(tag: 'stop-service');
_updateTimer?.cancel();

View File

@ -383,8 +383,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: bfb19c84a8244771488bc05cc5f9c9b5e0324cfd
resolved-ref: bfb19c84a8244771488bc05cc5f9c9b5e0324cfd
ref: "74b1b314142b6775c1243067a3503ac568ebc74b"
resolved-ref: "74b1b314142b6775c1243067a3503ac568ebc74b"
url: "https://github.com/Kingtous/rustdesk_flutter_custom_cursor"
source: git
version: "0.0.1"
@ -617,13 +617,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
menu_base:
dependency: transitive
description:
name: menu_base
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
meta:
dependency: transitive
description:
@ -892,13 +885,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
shortid:
dependency: transitive
description:
name: shortid
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
sky_engine:
dependency: transitive
description: flutter
@ -988,15 +974,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
tray_manager:
dependency: "direct main"
description:
path: "."
ref: "3aa37c86e47ea748e7b5507cbe59f2c54ebdb23a"
resolved-ref: "3aa37c86e47ea748e7b5507cbe59f2c54ebdb23a"
url: "https://github.com/Kingtous/rustdesk_tray_manager"
source: git
version: "0.1.8"
tuple:
dependency: "direct main"
description:
@ -1210,7 +1187,7 @@ packages:
source: hosted
version: "2.2.0"
win32:
dependency: transitive
dependency: "direct main"
description:
name: win32
url: "https://pub.dartlang.org"

View File

@ -65,10 +65,6 @@ dependencies:
url: https://github.com/Kingtous/rustdesk_desktop_multi_window
ref: cb086219bd4760a95a483cb14c1791d2a39ca5a0
freezed_annotation: ^2.0.3
tray_manager:
git:
url: https://github.com/Kingtous/rustdesk_tray_manager
ref: 3aa37c86e47ea748e7b5507cbe59f2c54ebdb23a
flutter_custom_cursor:
git:
url: https://github.com/Kingtous/rustdesk_flutter_custom_cursor