Loading services/inputflinger/dispatcher/InputDispatcher.cpp +8 −13 Original line number Diff line number Diff line Loading @@ -676,13 +676,13 @@ std::optional<nsecs_t> getDownTime(const EventEntry& eventEntry) { std::vector<TouchedWindow> getHoveringWindowsLocked(const TouchState* oldState, const TouchState& newTouchState, const MotionEntry& entry) { std::vector<TouchedWindow> out; const int32_t maskedAction = MotionEvent::getActionMasked(entry.action); if (maskedAction == AMOTION_EVENT_ACTION_SCROLL) { // ACTION_SCROLL events should not affect the hovering pointer dispatch return {}; } std::vector<TouchedWindow> out; // We should consider all hovering pointers here. But for now, just use the first one const PointerProperties& pointer = entry.pointerProperties[0]; Loading Loading @@ -2651,19 +2651,14 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked( { std::vector<TouchedWindow> hoveringWindows = getHoveringWindowsLocked(oldState, tempTouchState, entry); for (const TouchedWindow& touchedWindow : hoveringWindows) { std::optional<InputTarget> target = createInputTargetLocked(touchedWindow.windowHandle, touchedWindow.dispatchMode, touchedWindow.targetFlags, touchedWindow.getDownTimeInTarget(entry.deviceId)); if (!target) { continue; } // Hardcode to single hovering pointer for now. std::bitset<MAX_POINTER_ID + 1> pointerIds; pointerIds.set(entry.pointerProperties[0].id); target->addPointers(pointerIds, touchedWindow.windowHandle->getInfo()->transform); targets.push_back(*target); for (const TouchedWindow& touchedWindow : hoveringWindows) { addPointerWindowTargetLocked(touchedWindow.windowHandle, touchedWindow.dispatchMode, touchedWindow.targetFlags, pointerIds, touchedWindow.getDownTimeInTarget(entry.deviceId), targets); } } Loading Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +8 −13 Original line number Diff line number Diff line Loading @@ -676,13 +676,13 @@ std::optional<nsecs_t> getDownTime(const EventEntry& eventEntry) { std::vector<TouchedWindow> getHoveringWindowsLocked(const TouchState* oldState, const TouchState& newTouchState, const MotionEntry& entry) { std::vector<TouchedWindow> out; const int32_t maskedAction = MotionEvent::getActionMasked(entry.action); if (maskedAction == AMOTION_EVENT_ACTION_SCROLL) { // ACTION_SCROLL events should not affect the hovering pointer dispatch return {}; } std::vector<TouchedWindow> out; // We should consider all hovering pointers here. But for now, just use the first one const PointerProperties& pointer = entry.pointerProperties[0]; Loading Loading @@ -2651,19 +2651,14 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked( { std::vector<TouchedWindow> hoveringWindows = getHoveringWindowsLocked(oldState, tempTouchState, entry); for (const TouchedWindow& touchedWindow : hoveringWindows) { std::optional<InputTarget> target = createInputTargetLocked(touchedWindow.windowHandle, touchedWindow.dispatchMode, touchedWindow.targetFlags, touchedWindow.getDownTimeInTarget(entry.deviceId)); if (!target) { continue; } // Hardcode to single hovering pointer for now. std::bitset<MAX_POINTER_ID + 1> pointerIds; pointerIds.set(entry.pointerProperties[0].id); target->addPointers(pointerIds, touchedWindow.windowHandle->getInfo()->transform); targets.push_back(*target); for (const TouchedWindow& touchedWindow : hoveringWindows) { addPointerWindowTargetLocked(touchedWindow.windowHandle, touchedWindow.dispatchMode, touchedWindow.targetFlags, pointerIds, touchedWindow.getDownTimeInTarget(entry.deviceId), targets); } } Loading