remember remote window fullscreen, set global state
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
55fc0cb63b
commit
17af5622ec
@ -410,6 +410,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
|||||||
void onRemoveId(String id) async {
|
void onRemoveId(String id) async {
|
||||||
if (tabController.state.value.tabs.isEmpty) {
|
if (tabController.state.value.tabs.isEmpty) {
|
||||||
await WindowController.fromWindowId(windowId()).close();
|
await WindowController.fromWindowId(windowId()).close();
|
||||||
|
stateGlobal.setFullscreen(false, procWnd: false);
|
||||||
}
|
}
|
||||||
ConnectionTypeState.delete(id);
|
ConnectionTypeState.delete(id);
|
||||||
_update_remote_count();
|
_update_remote_count();
|
||||||
|
@ -64,7 +64,7 @@ class StateGlobal {
|
|||||||
|
|
||||||
setMinimized(bool v) => _isMinimized = v;
|
setMinimized(bool v) => _isMinimized = v;
|
||||||
|
|
||||||
setFullscreen(bool v) {
|
setFullscreen(bool v, {bool procWnd = true}) {
|
||||||
if (_fullscreen != v) {
|
if (_fullscreen != v) {
|
||||||
_fullscreen = v;
|
_fullscreen = v;
|
||||||
_showTabBar.value = !_fullscreen;
|
_showTabBar.value = !_fullscreen;
|
||||||
@ -76,20 +76,22 @@ class StateGlobal {
|
|||||||
print(
|
print(
|
||||||
"fullscreen: $fullscreen, resizeEdgeSize: ${_resizeEdgeSize.value}");
|
"fullscreen: $fullscreen, resizeEdgeSize: ${_resizeEdgeSize.value}");
|
||||||
_windowBorderWidth.value = fullscreen ? 0 : kWindowBorderWidth;
|
_windowBorderWidth.value = fullscreen ? 0 : kWindowBorderWidth;
|
||||||
WindowController.fromWindowId(windowId)
|
if (procWnd) {
|
||||||
.setFullscreen(_fullscreen)
|
WindowController.fromWindowId(windowId)
|
||||||
.then((_) {
|
.setFullscreen(_fullscreen)
|
||||||
// https://github.com/leanflutter/window_manager/issues/131#issuecomment-1111587982
|
.then((_) {
|
||||||
if (Platform.isWindows && !v) {
|
// https://github.com/leanflutter/window_manager/issues/131#issuecomment-1111587982
|
||||||
Future.delayed(Duration.zero, () async {
|
if (Platform.isWindows && !v) {
|
||||||
final frame =
|
Future.delayed(Duration.zero, () async {
|
||||||
await WindowController.fromWindowId(windowId).getFrame();
|
final frame =
|
||||||
final newRect = Rect.fromLTWH(
|
await WindowController.fromWindowId(windowId).getFrame();
|
||||||
frame.left, frame.top, frame.width + 1, frame.height + 1);
|
final newRect = Rect.fromLTWH(
|
||||||
await WindowController.fromWindowId(windowId).setFrame(newRect);
|
frame.left, frame.top, frame.width + 1, frame.height + 1);
|
||||||
});
|
await WindowController.fromWindowId(windowId).setFrame(newRect);
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user