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)
committerMauro Rossi <issor.oruam@gmail.com>
Mon, 24 Jul 2023 16:03:29 +0000 (18:03 +0200)
Since commit 78f97b326 ("Support pointer capture in InputReader") the
logic to determine whether mouse input is relative was changed.
However, commit 447a667 was forward ported from nougat-x86. It doesn't
consider that.

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

index 46d5783..b85dc4d 100644 (file)
@@ -381,7 +381,7 @@ void CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
         // Rotate delta according to orientation if needed.
         rotateDelta(mOrientation, &deltaX, &deltaY);
         mPointerVelocityControl.move(when, &deltaX, &deltaY);
-        if (mPointerController != NULL) {
+        if (mSource == AINPUT_SOURCE_MOUSE) {
             if (moved) {
                 mPointerController->move(deltaX, deltaY);
             }