refact, peer card menu, open in tabs or windows

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-08-08 12:12:35 +08:00
parent 6b375cb0a3
commit ac88f55f25
41 changed files with 187 additions and 100 deletions

View File

@@ -554,13 +554,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
} else if (call.method == kWindowEventShow) {
await rustDeskWinManager.registerActiveWindow(call.arguments["id"]);
} else if (call.method == kWindowEventHide) {
final wId = call.arguments['id'];
final isSeparateWindowEnabled =
mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow);
if (isSeparateWindowEnabled && !kCloseMultiWindowByHide) {
await rustDeskWinManager.destroyWindow(wId);
}
await rustDeskWinManager.unregisterActiveWindow(wId);
await rustDeskWinManager.unregisterActiveWindow(call.arguments['id']);
} else if (call.method == kWindowConnect) {
await connectMainDesktop(
call.arguments['id'],
@@ -568,7 +562,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
isTcpTunneling: call.arguments['isTcpTunneling'],
isRDP: call.arguments['isRDP'],
forceRelay: call.arguments['forceRelay'],
forceSeparateWindow: call.arguments['forceSeparateWindow'],
);
} else if (call.method == kWindowEventMoveTabToNewWindow) {
final args = call.arguments.split(',');

View File

@@ -319,8 +319,8 @@ class _GeneralState extends State<_General> {
_OptionCheckBox(context, 'Adaptive bitrate', 'enable-abr'),
_OptionCheckBox(
context,
'Separate remote windows',
kOptionSeparateRemoteWindow,
'Open new connections in tabs',
kOptionOpenNewConnInTabs,
isServer: false,
),
];

View File

@@ -116,7 +116,7 @@ class _RemotePageState extends State<RemotePage>
Wakelock.enable();
}
// Register texture.
if (mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow)) {
if (mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)) {
_renderTexture = renderTexture;
} else {
_renderTexture = RenderTexture();