Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

https://github.com/rustdesk/rustdesk/discussions/6453#discussioncomment-7752797

rustdesk674305ce292b
diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart
index d7e6265fa..b90fbea71 100644
--- a/flutter/lib/models/model.dart
+++ b/flutter/lib/models/model.dart
@@ -421,11 +421,10 @@ class FfiModel with ChangeNotifier {
return;
}
if (newRect != _rect) {
- if (updateCursorPos) {
- if (newRect.left != _rect?.left || newRect.top != _rect?.top) {
- parent.target?.cursorModel
- .updateDisplayOrigin(newRect.left, newRect.top);
- }
+ if (newRect.left != _rect?.left || newRect.top != _rect?.top) {
+ parent.target?.cursorModel.updateDisplayOrigin(
+ newRect.left, newRect.top,
+ updateCursorPos: updateCursorPos);
}
_rect = newRect;
parent.target?.canvasModel
@@ -1842,12 +1841,14 @@ class CursorModel with ChangeNotifier {
notifyListeners();
}
- updateDisplayOrigin(double x, double y) {
+ updateDisplayOrigin(double x, double y, {updateCursorPos = true}) {
_displayOriginX = x;
_displayOriginY = y;
- _x = x + 1;
- _y = y + 1;
- parent.target?.inputModel.moveMouse(x, y);
+ if (updateCursorPos) {
+ _x = x + 1;
+ _y = y + 1;
+ parent.target?.inputModel.moveMouse(x, y);
+ }
parent.target?.canvasModel.resetOffset();
notifyListeners();
}