Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix, connect the same peer

fufesou11388849de8b
diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart
index 1452270d1..d92f42a10 100644
--- a/flutter/lib/consts.dart
+++ b/flutter/lib/consts.dart
@@ -4,8 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import 'package:flutter_hbb/models/state_model.dart';
-const bool kOpenSamePeerInNewWindow = true;
-
const double kDesktopRemoteTabBarHeight = 28.0;
const int kInvalidWindowId = -1;
const int kMainWindowId = 0;
diff --git a/flutter/lib/utils/multi_window_manager.dart b/flutter/lib/utils/multi_window_manager.dart
index 8b80b79bf..f36370e40 100644
--- a/flutter/lib/utils/multi_window_manager.dart
+++ b/flutter/lib/utils/multi_window_manager.dart
@@ -2,7 +2,6 @@ import 'dart:convert';
import 'dart:io';
import 'package:desktop_multi_window/desktop_multi_window.dart';
-import 'package:flutter_hbb/models/platform_model.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -187,21 +186,11 @@ class RustDeskMultiWindowManager {
bool openInTabs = type != WindowType.RemoteDesktop ||
mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs);
- if (kOpenSamePeerInNewWindow) {
- // Open in new window if the peer is already connected.
- // No need to care about the previous session type.
- if (type == WindowType.RemoteDesktop &&
- await bind.sessionGetFlutterOptionByPeerId(id: remoteId, k: '') !=
- null) {
- openInTabs = false;
- }
- } else {
- if (windows.length > 1 || !openInTabs) {
- for (final windowId in windows) {
- if (await DesktopMultiWindow.invokeMethod(
- windowId, kWindowEventActiveSession, remoteId)) {
- return MultiWindowCallResult(windowId, null);
- }
+ if (windows.length > 1 || !openInTabs) {
+ for (final windowId in windows) {
+ if (await DesktopMultiWindow.invokeMethod(
+ windowId, kWindowEventActiveSession, remoteId)) {
+ return MultiWindowCallResult(windowId, null);
}
}
}