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

Commit 4c4f2646 authored by Harry Cutts's avatar Harry Cutts Committed by Automerger Merge Worker
Browse files

Merge "TouchpadInputMapper: send hover events after UP" into udc-qpr-dev am:...

Merge "TouchpadInputMapper: send hover events after UP" into udc-qpr-dev am: 175d715a am: 48afe34c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/23970606



Change-Id: Id26bbdf18e4f05cbdc0c4f11b9fb3aa7c91a07e1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0e84395d 48afe34c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -239,6 +239,11 @@ std::list<NotifyArgs> GestureConverter::handleButtonsChange(nsecs_t when, nsecs_
        out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_UP, /* actionButton= */ 0,
                                     newButtonState, /* pointerCount= */ 1, mFingerProps.data(),
                                     &coords, xCursorPosition, yCursorPosition));
        // Send a HOVER_MOVE to tell the application that the mouse is hovering again.
        out.push_back(makeMotionArgs(when, readTime, AMOTION_EVENT_ACTION_HOVER_MOVE,
                                     /*actionButton=*/0, newButtonState, /*pointerCount=*/1,
                                     mFingerProps.data(), &coords, xCursorPosition,
                                     yCursorPosition));
    }
    mButtonState = newButtonState;
    return out;
+10 −2
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ TEST_F(GestureConverterTest, ButtonsChange) {
                           /* down= */ GESTURES_BUTTON_NONE, /* up= */ GESTURES_BUTTON_RIGHT,
                           /* is_tap= */ false);
    args = converter.handleGesture(ARBITRARY_TIME, READ_TIME, rightUpGesture);
    ASSERT_EQ(2u, args.size());
    ASSERT_EQ(3u, args.size());

    ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()),
                AllOf(WithMotionAction(AMOTION_EVENT_ACTION_BUTTON_RELEASE),
@@ -181,6 +181,10 @@ TEST_F(GestureConverterTest, ButtonsChange) {
                AllOf(WithMotionAction(AMOTION_EVENT_ACTION_UP), WithButtonState(0),
                      WithCoords(POINTER_X, POINTER_Y),
                      WithToolType(ToolType::FINGER)));
    args.pop_front();
    ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()),
                AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_MOVE), WithButtonState(0),
                      WithCoords(POINTER_X, POINTER_Y), WithToolType(ToolType::FINGER)));
}

TEST_F(GestureConverterTest, DragWithButton) {
@@ -225,7 +229,7 @@ TEST_F(GestureConverterTest, DragWithButton) {
                      /* down= */ GESTURES_BUTTON_NONE, /* up= */ GESTURES_BUTTON_LEFT,
                      /* is_tap= */ false);
    args = converter.handleGesture(ARBITRARY_TIME, READ_TIME, upGesture);
    ASSERT_EQ(2u, args.size());
    ASSERT_EQ(3u, args.size());

    ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()),
                AllOf(WithMotionAction(AMOTION_EVENT_ACTION_BUTTON_RELEASE),
@@ -237,6 +241,10 @@ TEST_F(GestureConverterTest, DragWithButton) {
                AllOf(WithMotionAction(AMOTION_EVENT_ACTION_UP), WithButtonState(0),
                      WithCoords(POINTER_X - 5, POINTER_Y + 10),
                      WithToolType(ToolType::FINGER)));
    args.pop_front();
    ASSERT_THAT(std::get<NotifyMotionArgs>(args.front()),
                AllOf(WithMotionAction(AMOTION_EVENT_ACTION_HOVER_MOVE), WithButtonState(0),
                      WithCoords(POINTER_X - 5, POINTER_Y + 10), WithToolType(ToolType::FINGER)));
}

TEST_F(GestureConverterTest, Scroll) {
+2 −1
Original line number Diff line number Diff line
@@ -139,7 +139,8 @@ TEST_F(TouchpadInputMapperTest, HoverAndLeftButtonPress) {
                            VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_DOWN)),
                            VariantWith<NotifyMotionArgs>(WithMotionAction(BUTTON_PRESS)),
                            VariantWith<NotifyMotionArgs>(WithMotionAction(BUTTON_RELEASE)),
                            VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_UP))));
                            VariantWith<NotifyMotionArgs>(WithMotionAction(ACTION_UP)),
                            VariantWith<NotifyMotionArgs>(WithMotionAction(HOVER_MOVE))));

    // Liftoff
    args.clear();