OSDN Git Service

inputflinger: fix relative mouse movement
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 21 Feb 2020 07:52:13 +0000 (15:52 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 21 Feb 2020 07:52:13 +0000 (15:52 +0800)
Since commit 78f97b326 ("Support pointer capture in InputReader") the
logic to determine whether mouse input is relative was changed.
However, commit bf8d48c17 was forward ported from nougat-x86. It doesn't
consider that.

Fixes: bf8d48c17 ("inputflinger: treat tablet-style inputs as absolute coordinate mouse pointer")
Reported-and-tested-by: MrARM Slack <mrarm.slack@gmail.com>
services/inputflinger/InputReader.cpp

index e1d76a4..9bc111f 100644 (file)
@@ -2871,7 +2871,7 @@ void CursorInputMapper::sync(nsecs_t when) {
             rotateDelta(mOrientation, &deltaX, &deltaY);
         }
         mPointerVelocityControl.move(when, &deltaX, &deltaY);
-        if (mPointerController != NULL) {
+        if (mSource == AINPUT_SOURCE_MOUSE) {
             if (moved) {
                 mPointerController->move(deltaX, deltaY);
             }