feat: add dbus and cli connect support

This commit is contained in:
Kingtous
2022-10-11 19:52:03 +08:00
parent 5756bee266
commit 3d7736836f
18 changed files with 219 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ import 'package:flutter_hbb/models/chat_model.dart';
import 'package:flutter_hbb/models/file_model.dart';
import 'package:flutter_hbb/models/server_model.dart';
import 'package:flutter_hbb/models/user_model.dart';
import 'package:flutter_hbb/utils/multi_window_manager.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tuple/tuple.dart';
import 'package:flutter_custom_cursor/flutter_custom_cursor.dart';
@@ -176,6 +177,9 @@ class FfiModel with ChangeNotifier {
updateBlockInputState(evt, peerId);
} else if (name == 'update_privacy_mode') {
updatePrivacyMode(evt, peerId);
} else if (name == 'new_connection') {
final remoteId = evt['peer_id'];
rustDeskWinManager.newRemoteDesktop(remoteId);
}
};
}

View File

@@ -113,6 +113,10 @@ class PlatformFFI {
debugPrint('Failed to get documents directory: $e');
}
_ffiBind = RustdeskImpl(dylib);
if (Platform.isLinux) {
// start dbus service, no need to await
await _ffiBind.mainStartDbusServer();
}
_startListenEvent(_ffiBind); // global event
try {
if (isAndroid) {