Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java

Issue 2166423003: [Remoting Android] Fix dragging issue in direct input mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java b/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
index a2cb69e51b1c1cf0166adea7db69cda36dce462b..26ba165d89f8958ce2448cdfbe21ea432bc399ce 100644
--- a/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
+++ b/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
@@ -394,9 +394,9 @@ public class TouchInputHandler {
// If the user is dragging, then the viewport should always follow the user's finger.
PointF newPos = mDesktopCanvas.moveViewportCenter(!followCursor, deltaX, deltaY);
- // If we are in an indirect mode or are in the middle of a drag operation, then we want to
- // keep the cursor centered, if possible, as the viewport moves.
- if (followCursor) {
+ // If we are in an indirect mode, then we want to keep the cursor centered, if possible, as
+ // the viewport moves.
+ if (mInputStrategy.isIndirectInputMode()) {
moveCursor((int) newPos.x, (int) newPos.y);
}
@@ -503,6 +503,11 @@ public class TouchInputHandler {
}
moveViewportByOffset(delta[0], delta[1]);
+ if (!mInputStrategy.isIndirectInputMode() && mIsDragging) {
+ // Ensure the cursor follows the user's finger when the user is dragging under
+ // direct input mode.
+ moveCursorToScreenPoint(e2.getX(), e2.getY());
+ }
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698