From 7833c7ce31a4772d2a6293aa5e4504db98e2b2ea Mon Sep 17 00:00:00 2001 From: Kingtous Date: Fri, 10 Mar 2023 00:15:07 +0800 Subject: [PATCH] fix: window overflow & prevent setMaximize when fullscreen --- flutter/lib/models/state_model.dart | 13 +++++++++---- flutter/pubspec.yaml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/flutter/lib/models/state_model.dart b/flutter/lib/models/state_model.dart index aa4fab86e..187b1ffc5 100644 --- a/flutter/lib/models/state_model.dart +++ b/flutter/lib/models/state_model.dart @@ -28,10 +28,9 @@ class StateGlobal { setWindowId(int id) => _windowId = id; setMaximize(bool v) { - if (_maximize != v) { + if (_maximize != v && !_fullscreen) { _maximize = v; - _resizeEdgeSize.value = - _maximize ? kMaximizeEdgeSize : kWindowEdgeSize; + _resizeEdgeSize.value = _maximize ? kMaximizeEdgeSize : kWindowEdgeSize; } } setFullscreen(bool v) { @@ -39,7 +38,13 @@ class StateGlobal { _fullscreen = v; _showTabBar.value = !_fullscreen; _resizeEdgeSize.value = - fullscreen ? kFullScreenEdgeSize : kWindowEdgeSize; + fullscreen + ? kFullScreenEdgeSize + : _maximize + ? kMaximizeEdgeSize + : kWindowEdgeSize; + print( + "fullscreen: ${fullscreen}, resizeEdgeSize: ${_resizeEdgeSize.value}"); _windowBorderWidth.value = fullscreen ? 0 : kWindowBorderWidth; WindowController.fromWindowId(windowId) .setFullscreen(_fullscreen) diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index ccb53cc9c..087fba71e 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -59,7 +59,7 @@ dependencies: desktop_multi_window: git: url: https://github.com/Kingtous/rustdesk_desktop_multi_window - ref: 3e2655677c54f421f9e378680d8171b95a211e0f + ref: e3947d4b4f8edaa655de63cd47f2a59a6e024218 freezed_annotation: ^2.0.3 flutter_custom_cursor: ^0.0.4 window_size: