Skip to content

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

Change the offset depending on the platform

dignowfb12ba8a2b85
diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart
index 9a22a8f89..c6b613475 100644
--- a/flutter/lib/common.dart
+++ b/flutter/lib/common.dart
@@ -1715,18 +1715,18 @@ Future<bool> restoreWindowPosition(WindowType type,
if (type == WindowType.RemoteDesktop) {
if (!isRemotePeerPos && windowId != null) {
if (lpos.offsetWidth != null) {
- lpos.offsetWidth = lpos.offsetWidth! + windowId * 20;
+ lpos.offsetWidth = lpos.offsetWidth! + windowId * kNewWindowOffset;
}
if (lpos.offsetHeight != null) {
- lpos.offsetHeight = lpos.offsetHeight! + windowId * 20;
+ lpos.offsetHeight = lpos.offsetHeight! + windowId * kNewWindowOffset;
}
}
if (display != null) {
if (lpos.offsetWidth != null) {
- lpos.offsetWidth = lpos.offsetWidth! + display * 30;
+ lpos.offsetWidth = lpos.offsetWidth! + display * kNewWindowOffset;
}
if (lpos.offsetHeight != null) {
- lpos.offsetHeight = lpos.offsetHeight! + display * 30;
+ lpos.offsetHeight = lpos.offsetHeight! + display * kNewWindowOffset;
}
}
}
diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart
index e4d777ccb..e3339c1ec 100644
--- a/flutter/lib/consts.dart
+++ b/flutter/lib/consts.dart
@@ -66,8 +66,10 @@ const int kWindowMainId = 0;
const String kPointerEventKindTouch = "touch";
const String kPointerEventKindMouse = "mouse";
-const String kKeyShowDisplaysAsIndividualWindows = 'displays_as_individual_windows';
-const String kKeyUseAllMyDisplaysForTheRemoteSession = 'use_all_my_displays_for_the_remote_session';
+const String kKeyShowDisplaysAsIndividualWindows =
+ 'displays_as_individual_windows';
+const String kKeyUseAllMyDisplaysForTheRemoteSession =
+ 'use_all_my_displays_for_the_remote_session';
const String kKeyShowMonitorsToolbar = 'show_monitors_toolbar';
// the executable name of the portable version
@@ -87,6 +89,14 @@ const int kDesktopMaxDisplaySize = 3840;
const double kDesktopFileTransferRowHeight = 30.0;
const double kDesktopFileTransferHeaderHeight = 25.0;
+double kNewWindowOffset = Platform.isWindows
+ ? 56.0
+ : Platform.isLinux
+ ? 50.0
+ : Platform.isMacOS
+ ? 30.0
+ : 50.0;
+
EdgeInsets get kDragToResizeAreaPadding =>
!kUseCompatibleUiMode && Platform.isLinux
? stateGlobal.fullscreen.isTrue || stateGlobal.isMaximized.value