Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a223681 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Automerger Merge Worker
Browse files

Merge "Fix display association for drawing tablets - part 2" into udc-dev am: 6a208de5

parents 2223b52a 6a208de5
Loading
Loading
Loading
Loading
+31 −28
Original line number Diff line number Diff line
@@ -3601,7 +3601,10 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                        "%s cannot be used when the device is not in POINTER mode.", __func__);
    std::list<NotifyArgs> out;
    int32_t metaState = getContext()->getGlobalMetaState();
    auto cursorPosition = mPointerSimple.currentCoords.getXYValue();

    if (displayId == mPointerController->getDisplayId()) {
        std::tie(cursorPosition.x, cursorPosition.y) = mPointerController->getPosition();
        if (down || hovering) {
            mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER);
            mPointerController->clearSpots();
@@ -3609,8 +3612,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
        } else if (!down && !hovering && (mPointerSimple.down || mPointerSimple.hovering)) {
            mPointerController->fade(PointerControllerInterface::Transition::GRADUAL);
        }

    const auto [xCursorPosition, yCursorPosition] = mPointerController->getPosition();
    }

    if (mPointerSimple.down && !down) {
        mPointerSimple.down = false;
@@ -3621,8 +3623,9 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                       0, metaState, mLastRawState.buttonState,
                                       MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                       &mPointerSimple.lastProperties, &mPointerSimple.lastCoords,
                                       mOrientedXPrecision, mOrientedYPrecision, xCursorPosition,
                                       yCursorPosition, mPointerSimple.downTime,
                                       mOrientedXPrecision, mOrientedYPrecision,
                                       mPointerSimple.lastCursorX, mPointerSimple.lastCursorY,
                                       mPointerSimple.downTime,
                                       /* videoFrames */ {}));
    }

@@ -3630,14 +3633,14 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
        mPointerSimple.hovering = false;

        // Send hover exit.
        out.push_back(NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(),
                                       mSource, displayId, policyFlags,
                                       AMOTION_EVENT_ACTION_HOVER_EXIT, 0, 0, metaState,
                                       mLastRawState.buttonState, MotionClassification::NONE,
                                       AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                       &mPointerSimple.lastProperties, &mPointerSimple.lastCoords,
                                       mOrientedXPrecision, mOrientedYPrecision, xCursorPosition,
                                       yCursorPosition, mPointerSimple.downTime,
        out.push_back(
                NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(), mSource,
                                 displayId, policyFlags, AMOTION_EVENT_ACTION_HOVER_EXIT, 0, 0,
                                 metaState, mLastRawState.buttonState, MotionClassification::NONE,
                                 AMOTION_EVENT_EDGE_FLAG_NONE, 1, &mPointerSimple.lastProperties,
                                 &mPointerSimple.lastCoords, mOrientedXPrecision,
                                 mOrientedYPrecision, mPointerSimple.lastCursorX,
                                 mPointerSimple.lastCursorY, mPointerSimple.downTime,
                                 /* videoFrames */ {}));
    }

@@ -3654,7 +3657,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                           AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                           &mPointerSimple.currentProperties,
                                           &mPointerSimple.currentCoords, mOrientedXPrecision,
                                           mOrientedYPrecision, xCursorPosition, yCursorPosition,
                                           mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                           mPointerSimple.downTime, /* videoFrames */ {}));
        }

@@ -3665,7 +3668,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                       MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                       &mPointerSimple.currentProperties,
                                       &mPointerSimple.currentCoords, mOrientedXPrecision,
                                       mOrientedYPrecision, xCursorPosition, yCursorPosition,
                                       mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                       mPointerSimple.downTime, /* videoFrames */ {}));
    }

@@ -3681,7 +3684,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                           AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                           &mPointerSimple.currentProperties,
                                           &mPointerSimple.currentCoords, mOrientedXPrecision,
                                           mOrientedYPrecision, xCursorPosition, yCursorPosition,
                                           mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                           mPointerSimple.downTime, /* videoFrames */ {}));
        }

@@ -3692,8 +3695,8 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                 metaState, mCurrentRawState.buttonState,
                                 MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                 &mPointerSimple.currentProperties, &mPointerSimple.currentCoords,
                                 mOrientedXPrecision, mOrientedYPrecision, xCursorPosition,
                                 yCursorPosition, mPointerSimple.downTime, /* videoFrames */ {}));
                                 mOrientedXPrecision, mOrientedYPrecision, cursorPosition.x,
                                 cursorPosition.y, mPointerSimple.downTime, /* videoFrames */ {}));
    }

    if (mCurrentRawState.rawVScroll || mCurrentRawState.rawHScroll) {
@@ -3713,8 +3716,8 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                       0, 0, metaState, mCurrentRawState.buttonState,
                                       MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                       &mPointerSimple.currentProperties, &pointerCoords,
                                       mOrientedXPrecision, mOrientedYPrecision, xCursorPosition,
                                       yCursorPosition, mPointerSimple.downTime,
                                       mOrientedXPrecision, mOrientedYPrecision, cursorPosition.x,
                                       cursorPosition.y, mPointerSimple.downTime,
                                       /* videoFrames */ {}));
    }

@@ -3724,8 +3727,8 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
        mPointerSimple.lastProperties.copyFrom(mPointerSimple.currentProperties);
        mPointerSimple.displayId = displayId;
        mPointerSimple.source = mSource;
        mPointerSimple.lastCursorX = xCursorPosition;
        mPointerSimple.lastCursorY = yCursorPosition;
        mPointerSimple.lastCursorX = cursorPosition.x;
        mPointerSimple.lastCursorY = cursorPosition.y;
    } else {
        mPointerSimple.reset();
    }