Merge pull request #664 from Kingtous/flutter_desktop

fix: method channel in multi window context
This commit is contained in:
RustDesk 2022-05-31 12:23:22 +08:00 committed by GitHub
commit 00ba7cad81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 19 deletions

View File

@ -7,6 +7,7 @@ import 'package:flutter_hbb/desktop/screen/desktop_remote_screen.dart';
import 'package:flutter_hbb/utils/multi_window_manager.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:provider/provider.dart';
import 'package:window_manager/window_manager.dart';
import 'common.dart';
import 'mobile/pages/home_page.dart';
@ -32,6 +33,8 @@ void runRustDeskApp(List<String> args) async {
runApp(App());
return;
}
// main window
await windowManager.ensureInitialized();
if (args.isNotEmpty && args.first == 'multi_window') {
windowId = int.parse(args[1]);
final argument = args[2].isEmpty
@ -49,21 +52,7 @@ void runRustDeskApp(List<String> args) async {
break;
}
} else {
// main window
// await windowManager.ensureInitialized();
// start service
FFI.serverModel.startService();
// WindowOptions windowOptions = WindowOptions(
// size: Size(1280, 720),
// center: true,
// backgroundColor: Colors.transparent,
// skipTaskbar: false,
// titleBarStyle: TitleBarStyle.normal,
// );
// windowManager.waitUntilReadyToShow(windowOptions, () async {
// await windowManager.show();
// await windowManager.focus();
// });
runApp(App());
doWhenWindowReady(() {
const initialSize = Size(1280, 720);

View File

@ -123,10 +123,12 @@ packages:
desktop_multi_window:
dependency: "direct main"
description:
name: desktop_multi_window
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2"
path: "."
ref: master
resolved-ref: "7150283dcd0c79450b98bf0a62b26df95897e53c"
url: "https://github.com/Kingtous/rustdesk_desktop_multi_window"
source: git
version: "0.0.1"
device_info_plus:
dependency: "direct main"
description:

View File

@ -56,7 +56,10 @@ dependencies:
flutter_smart_dialog: ^4.3.1
flutter_rust_bridge: ^1.30.0
window_manager: ^0.2.3
desktop_multi_window: ^0.0.2
desktop_multi_window:
git:
url: https://github.com/Kingtous/rustdesk_desktop_multi_window
ref: master
bitsdojo_window: ^0.1.2
dev_dependencies: