Merge pull request #1227 from Kingtous/flutter_desktop
fix: avoid window manager re-register in sub window
This commit is contained in:
commit
0697a5bf96
@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:desktop_multi_window/desktop_multi_window.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hbb/common.dart';
|
import 'package:flutter_hbb/common.dart';
|
||||||
import 'package:flutter_hbb/consts.dart';
|
import 'package:flutter_hbb/consts.dart';
|
||||||
@ -114,7 +115,11 @@ class _ConnectionTabPageState extends State<ConnectionTabPage>
|
|||||||
tabController.value = TabController(
|
tabController.value = TabController(
|
||||||
length: connectionIds.length, vsync: this, initialIndex: initialIndex);
|
length: connectionIds.length, vsync: this, initialIndex: initialIndex);
|
||||||
if (connectionIds.length == 0) {
|
if (connectionIds.length == 0) {
|
||||||
windowManager.close();
|
WindowController.fromWindowId(windowId()).close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int windowId() {
|
||||||
|
return widget.params["windowId"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:desktop_multi_window/desktop_multi_window.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hbb/common.dart';
|
import 'package:flutter_hbb/common.dart';
|
||||||
import 'package:flutter_hbb/desktop/pages/file_manager_page.dart';
|
import 'package:flutter_hbb/desktop/pages/file_manager_page.dart';
|
||||||
@ -114,7 +115,11 @@ class _FileManagerTabPageState extends State<FileManagerTabPage>
|
|||||||
tabController.value = TabController(
|
tabController.value = TabController(
|
||||||
length: connectionIds.length, initialIndex: initialIndex, vsync: this);
|
length: connectionIds.length, initialIndex: initialIndex, vsync: this);
|
||||||
if (connectionIds.length == 0) {
|
if (connectionIds.length == 0) {
|
||||||
windowManager.close();
|
WindowController.fromWindowId(windowId()).close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int windowId() {
|
||||||
|
return widget.params["windowId"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ Future<Null> main(List<String> args) async {
|
|||||||
? Map<String, dynamic>()
|
? Map<String, dynamic>()
|
||||||
: jsonDecode(args[2]) as Map<String, dynamic>;
|
: jsonDecode(args[2]) as Map<String, dynamic>;
|
||||||
int type = argument['type'] ?? -1;
|
int type = argument['type'] ?? -1;
|
||||||
|
argument['windowId'] = windowId;
|
||||||
WindowType wType = type.windowType;
|
WindowType wType = type.windowType;
|
||||||
switch (wType) {
|
switch (wType) {
|
||||||
case WindowType.RemoteDesktop:
|
case WindowType.RemoteDesktop:
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -28,13 +28,13 @@ dependencies:
|
|||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.3
|
cupertino_icons: ^1.0.3
|
||||||
ffi: ^1.1.2
|
ffi: ^2.0.1
|
||||||
path_provider: ^2.0.2
|
path_provider: ^2.0.2
|
||||||
external_path: ^1.0.1
|
external_path: ^1.0.1
|
||||||
provider: ^6.0.3
|
provider: ^6.0.3
|
||||||
tuple: ^2.0.0
|
tuple: ^2.0.0
|
||||||
wakelock: ^0.5.2
|
wakelock: ^0.5.2
|
||||||
device_info_plus: ^3.2.3
|
device_info_plus: ^4.0.2
|
||||||
firebase_analytics: ^9.1.5
|
firebase_analytics: ^9.1.5
|
||||||
package_info_plus: ^1.4.2
|
package_info_plus: ^1.4.2
|
||||||
url_launcher: ^6.0.9
|
url_launcher: ^6.0.9
|
||||||
@ -55,11 +55,14 @@ dependencies:
|
|||||||
url: https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge
|
url: https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge
|
||||||
ref: master
|
ref: master
|
||||||
path: frb_dart
|
path: frb_dart
|
||||||
window_manager: ^0.2.5
|
window_manager:
|
||||||
|
git:
|
||||||
|
url: https://github.com/Kingtous/rustdesk_window_manager
|
||||||
|
ref: 028a7f6
|
||||||
desktop_multi_window:
|
desktop_multi_window:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/Kingtous/rustdesk_desktop_multi_window
|
url: https://github.com/Kingtous/rustdesk_desktop_multi_window
|
||||||
ref: 7cd2d885e58397766f3f03a1e632299944580aac
|
ref: ce9e333d822fe6cbf91c8634bae023bf78700d94
|
||||||
# bitsdojo_window: ^0.1.2
|
# bitsdojo_window: ^0.1.2
|
||||||
freezed_annotation: ^2.0.3
|
freezed_annotation: ^2.0.3
|
||||||
tray_manager: 0.1.7
|
tray_manager: 0.1.7
|
||||||
|
Loading…
x
Reference in New Issue
Block a user