Skip to content

Commit

Permalink
fix: mobile, don't adjust canvas on gesture help show up (rustdesk#9846)
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou authored Nov 7, 2024
1 parent faf97c7 commit 69277dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flutter/lib/models/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1475,14 +1475,16 @@ class CanvasModel with ChangeNotifier {
if (isMobile) {
h = h -
mediaData.viewInsets.bottom -
(parent.target?.cursorModel.keyHelpToolsRect?.bottom ?? 0);
(parent.target?.cursorModel.keyHelpToolsRectToAdjustCanvas?.bottom ??
0);
}
return Size(w < 0 ? 0 : w, h < 0 ? 0 : h);
}

// mobile only
double getAdjustY() {
final bottom = parent.target?.cursorModel.keyHelpToolsRect?.bottom ?? 0;
final bottom =
parent.target?.cursorModel.keyHelpToolsRectToAdjustCanvas?.bottom ?? 0;
return max(bottom - MediaQueryData.fromView(ui.window).padding.top, 0);
}

Expand Down Expand Up @@ -1939,7 +1941,8 @@ class CursorModel with ChangeNotifier {
bool _lastIsBlocked = false;
bool _lastKeyboardIsVisible = false;

Rect? get keyHelpToolsRect => _keyHelpToolsRect;
Rect? get keyHelpToolsRectToAdjustCanvas =>
_lastKeyboardIsVisible ? _keyHelpToolsRect : null;
keyHelpToolsVisibilityChanged(Rect? r, bool keyboardIsVisible) {
_keyHelpToolsRect = r;
if (r == null) {
Expand Down

0 comments on commit 69277dd

Please sign in to comment.