open_multi_windows, check before move and set fullscreen
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
bf83d552f8
commit
19945df0b3
@ -1675,7 +1675,6 @@ Future<Offset?> _adjustRestoreMainWindowOffset(
|
|||||||
/// Note that windowId must be provided if it's subwindow
|
/// Note that windowId must be provided if it's subwindow
|
||||||
Future<bool> restoreWindowPosition(WindowType type,
|
Future<bool> restoreWindowPosition(WindowType type,
|
||||||
{int? windowId, String? peerId}) async {
|
{int? windowId, String? peerId}) async {
|
||||||
debugPrintStack(label: "restoreWindowPosition");
|
|
||||||
if (bind
|
if (bind
|
||||||
.mainGetEnv(key: "DISABLE_RUSTDESK_RESTORE_WINDOW_POSITION")
|
.mainGetEnv(key: "DISABLE_RUSTDESK_RESTORE_WINDOW_POSITION")
|
||||||
.isNotEmpty) {
|
.isNotEmpty) {
|
||||||
@ -2707,9 +2706,18 @@ tryMoveToScreenAndSetFullscreen(Rect? screenRect) async {
|
|||||||
if (screenRect == null) {
|
if (screenRect == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
final wc = WindowController.fromWindowId(stateGlobal.windowId);
|
||||||
|
final curFrame = await wc.getFrame();
|
||||||
final frame =
|
final frame =
|
||||||
Rect.fromLTWH(screenRect.left + 30, screenRect.top + 30, 600, 400);
|
Rect.fromLTWH(screenRect.left + 30, screenRect.top + 30, 600, 400);
|
||||||
await WindowController.fromWindowId(stateGlobal.windowId).setFrame(frame);
|
if (stateGlobal.fullscreen &&
|
||||||
|
curFrame.left <= frame.left &&
|
||||||
|
curFrame.top <= frame.top &&
|
||||||
|
curFrame.width >= frame.width &&
|
||||||
|
curFrame.height >= frame.height) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await wc.setFrame(frame);
|
||||||
// An duration is needed to avoid the window being restored after fullscreen.
|
// An duration is needed to avoid the window being restored after fullscreen.
|
||||||
Future.delayed(Duration(milliseconds: 300), () async {
|
Future.delayed(Duration(milliseconds: 300), () async {
|
||||||
stateGlobal.setFullscreen(true);
|
stateGlobal.setFullscreen(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user