diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index a73ddfdaf..c8dcbbfba 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -31,6 +31,7 @@ const kDefaultScrollDuration = Duration(milliseconds: 50); const kDefaultMouseWheelThrottleDuration = Duration(milliseconds: 50); const kFullScreenEdgeSize = 0.0; var kWindowEdgeSize = Platform.isWindows ? 1.0 : 5.0; +const kWindowBorderWidth = 1.0; const kInvalidValueStr = "InvalidValueStr"; diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 48c6c0ae3..1d7a499e5 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -27,10 +27,12 @@ class RemotePage extends StatefulWidget { Key? key, required this.id, required this.tabBarHeight, + required this.windowBorderWidth, }) : super(key: key); final String id; final double tabBarHeight; + final double windowBorderWidth; @override State createState() => _RemotePageState(); @@ -54,6 +56,7 @@ class _RemotePageState extends State void _updateTabBarHeight() { _ffi.canvasModel.tabBarHeight = widget.tabBarHeight; + _ffi.canvasModel.windowBorderWidth = widget.windowBorderWidth; } void _initStates(String id) { diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index 9cf6532d5..7b38488fb 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -42,11 +42,13 @@ class _ConnectionTabPageState extends State { selectedIcon: selectedIcon, unselectedIcon: unselectedIcon, onTabCloseButton: () => handleTabCloseButton(peerId), - page: RemotePage( - key: ValueKey(peerId), - id: peerId, - tabBarHeight: fullscreen.isTrue ? 0 : kDesktopRemoteTabBarHeight, - ))); + page: Obx(() => RemotePage( + key: ValueKey(peerId), + id: peerId, + tabBarHeight: + fullscreen.isTrue ? 0 : kDesktopRemoteTabBarHeight, + windowBorderWidth: fullscreen.isTrue ? 0 : kWindowBorderWidth, + )))); } } @@ -74,11 +76,13 @@ class _ConnectionTabPageState extends State { selectedIcon: selectedIcon, unselectedIcon: unselectedIcon, onTabCloseButton: () => handleTabCloseButton(id), - page: RemotePage( - key: ValueKey(id), - id: id, - tabBarHeight: fullscreen.isTrue ? 0 : kDesktopRemoteTabBarHeight, - ))); + page: Obx(() => RemotePage( + key: ValueKey(id), + id: id, + tabBarHeight: + fullscreen.isTrue ? 0 : kDesktopRemoteTabBarHeight, + windowBorderWidth: fullscreen.isTrue ? 0 : kWindowBorderWidth, + )))); } else if (call.method == "onDestroy") { tabController.clear(); } @@ -90,7 +94,9 @@ class _ConnectionTabPageState extends State { final RxBool fullscreen = Get.find(tag: 'fullscreen'); final tabWidget = Container( decoration: BoxDecoration( - border: Border.all(color: MyTheme.color(context).border!)), + border: Border.all( + color: MyTheme.color(context).border!, + width: kWindowBorderWidth)), child: Scaffold( backgroundColor: Theme.of(context).backgroundColor, body: Obx(() => DesktopTab( diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 255ecb6d6..6df5f3d50 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -298,7 +298,7 @@ class FfiModel with ChangeNotifier { if (_pi.currentDisplay < _pi.displays.length) { _display = _pi.displays[_pi.currentDisplay]; } - if (displays.length > 0) { + if (displays.isNotEmpty) { parent.target?.dialogManager.showLoading( translate('Connected, waiting for image...'), onCancel: closeConnection); @@ -472,6 +472,8 @@ class CanvasModel with ChangeNotifier { double _scale = 1.0; // the tabbar over the image double tabBarHeight = 0.0; + // the window border's width + double windowBorderWidth = 0.0; // remote id String id = ''; // scroll offset x percent @@ -559,7 +561,8 @@ class CanvasModel with ChangeNotifier { Size get size { final size = MediaQueryData.fromWindow(ui.window).size; - return Size(size.width, size.height - tabBarHeight); + return Size(size.width - windowBorderWidth * 2, + size.height - tabBarHeight - windowBorderWidth * 2); } moveDesktopMouse(double x, double y) {