From 79411430a55ca7c4bf8216cfebfdff3d218adbb6 Mon Sep 17 00:00:00 2001 From: fufesou Date: Sat, 16 Dec 2023 21:41:55 +0800 Subject: [PATCH] Fix. Windows snap-function (#6680) Signed-off-by: fufesou --- flutter/lib/models/input_model.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flutter/lib/models/input_model.dart b/flutter/lib/models/input_model.dart index 458ccf3ad..eeff4d2bb 100644 --- a/flutter/lib/models/input_model.dart +++ b/flutter/lib/models/input_model.dart @@ -890,9 +890,11 @@ class InputModel { } int minX = rect.left.toInt(); - int maxX = (rect.left + rect.width).toInt() - 1; + // https://github.com/rustdesk/rustdesk/issues/6678 + // For Windows, [0,maxX], [0,maxY] should be set to enable window snapping. + int maxX = (rect.left + rect.width).toInt() - (peerPlatform == kPeerPlatformWindows ? 0 : 1); int minY = rect.top.toInt(); - int maxY = (rect.top + rect.height).toInt() - 1; + int maxY = (rect.top + rect.height).toInt() - (peerPlatform == kPeerPlatformWindows ? 0 : 1); evtX = trySetNearestRange(evtX, minX, maxX, 5); evtY = trySetNearestRange(evtY, minY, maxY, 5); if (kind == kPointerEventKindMouse) {