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

Commit 75789cd7 authored by Seunghwan Choi's avatar Seunghwan Choi Committed by Prabir Pradhan
Browse files

Separate default pointer for mouse and stylus (native part)

Let PointerController (MouseCursorController) know the source of
the current event, either mouse or stylus.
MouseCursorController will show the proper default pointer for
the active source, if the requested pointer type is TYPE_NOT_SPECIFIED.

Test: Manual Test
Bug: b/215436642
Change-Id: I91f702db661846fc7ad857f71656903c8aa4334a
parent 032c7dcf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1113,6 +1113,7 @@ public:
enum class PointerIconStyle : int32_t {
    TYPE_CUSTOM = -1,
    TYPE_NULL = 0,
    TYPE_NOT_SPECIFIED = 1,
    TYPE_ARROW = 1000,
    TYPE_CONTEXT_MENU = 1001,
    TYPE_HAND = 1002,
+3 −1
Original line number Diff line number Diff line
@@ -79,8 +79,10 @@ public:
        POINTER,
        // Show spots and a spot anchor in place of the mouse pointer.
        SPOT,
        // Show the stylus hover pointer.
        STYLUS_HOVER,

        ftl_last = SPOT,
        ftl_last = STYLUS_HOVER,
    };

    /* Sets the mode of the pointer controller. */
+4 −3
Original line number Diff line number Diff line
@@ -3699,13 +3699,14 @@ NotifyMotionArgs TouchInputMapper::dispatchMotion(
            ALOG_ASSERT(false);
        }
    }
    const bool isStylus = isStylusEvent(source, action, pointerProperties);
    if (isStylus) {
    const bool isDirectStylus =
            mDeviceMode == DeviceMode::DIRECT && isStylusEvent(source, action, pointerProperties);
    if (isDirectStylus) {
        switch (action & AMOTION_EVENT_ACTION_MASK) {
            case AMOTION_EVENT_ACTION_HOVER_ENTER:
            case AMOTION_EVENT_ACTION_HOVER_MOVE:
                mPointerController->setPresentation(
                        PointerControllerInterface::Presentation::POINTER);
                        PointerControllerInterface::Presentation::STYLUS_HOVER);
                mPointerController
                        ->setPosition(mCurrentCookedState.cookedPointerData.pointerCoords[0].getX(),
                                      mCurrentCookedState.cookedPointerData.pointerCoords[0]