fix: linux, custom client, incoming, window size (#7995)
* fix: linux, custom client, incoming, window size Signed-off-by: fufesou <shuanglongchen@yeah.net> * comments Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
a595d83232
commit
73662ed7d9
@ -3257,3 +3257,5 @@ Widget buildVirtualWindowFrame(BuildContext context, Widget child) {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
get windowEdgeSize => isLinux && bind.isIncomingOnly() ? 0.0 : kWindowEdgeSize;
|
||||
|
@ -262,7 +262,7 @@ class _ConnectionPageState extends State<ConnectionPage>
|
||||
void onWindowLeaveFullScreen() {
|
||||
// Restore edge border to default edge size.
|
||||
stateGlobal.resizeEdgeSize.value =
|
||||
stateGlobal.isMaximized.isTrue ? kMaximizeEdgeSize : kWindowEdgeSize;
|
||||
stateGlobal.isMaximized.isTrue ? kMaximizeEdgeSize : windowEdgeSize;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -144,7 +144,12 @@ void runMainApp(bool startService) async {
|
||||
}
|
||||
windowManager.setOpacity(1);
|
||||
windowManager.setTitle(getWindowName());
|
||||
windowManager.setResizable(!bind.isIncomingOnly());
|
||||
// `windowManager.setResizable(false)` will reset the window size to the default size on Linux.
|
||||
// https://stackoverflow.com/questions/8193613/gtk-window-resize-disable-without-going-back-to-default
|
||||
if (!isLinux) {
|
||||
windowManager.setResizable(!bind.isIncomingOnly());
|
||||
}
|
||||
// For Linux, we set the edge size to 0 to disable resize. See `get windowEdgeSize` in common.dart.
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ class StateGlobal {
|
||||
bool _isMinimized = false;
|
||||
final RxBool isMaximized = false.obs;
|
||||
final RxBool _showTabBar = true.obs;
|
||||
final RxDouble _resizeEdgeSize = RxDouble(kWindowEdgeSize);
|
||||
final RxDouble _resizeEdgeSize = RxDouble(windowEdgeSize);
|
||||
final RxDouble _windowBorderWidth = RxDouble(kWindowBorderWidth);
|
||||
final RxBool showRemoteToolBar = false.obs;
|
||||
final svcStatus = SvcStatus.notReady.obs;
|
||||
@ -57,7 +57,7 @@ class StateGlobal {
|
||||
if (isMaximized.value != v) {
|
||||
isMaximized.value = v;
|
||||
_resizeEdgeSize.value =
|
||||
isMaximized.isTrue ? kMaximizeEdgeSize : kWindowEdgeSize;
|
||||
isMaximized.isTrue ? kMaximizeEdgeSize : windowEdgeSize;
|
||||
}
|
||||
if (!isMacOS) {
|
||||
_windowBorderWidth.value = v ? 0 : kWindowBorderWidth;
|
||||
@ -75,7 +75,7 @@ class StateGlobal {
|
||||
? kFullScreenEdgeSize
|
||||
: isMaximized.isTrue
|
||||
? kMaximizeEdgeSize
|
||||
: kWindowEdgeSize;
|
||||
: windowEdgeSize;
|
||||
print(
|
||||
"fullscreen: $fullscreen, resizeEdgeSize: ${_resizeEdgeSize.value}");
|
||||
_windowBorderWidth.value = fullscreen.isTrue ? 0 : kWindowBorderWidth;
|
||||
@ -113,4 +113,5 @@ class StateGlobal {
|
||||
static final StateGlobal instance = StateGlobal._();
|
||||
}
|
||||
|
||||
// This final variable is initialized when the first time it is accessed.
|
||||
final stateGlobal = StateGlobal.instance;
|
||||
|
Loading…
x
Reference in New Issue
Block a user