mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-02-21 21:23:22 +00:00
!45696 修复高负载场景下长按多选拖拽无法触发的问题
Merge pull request !45696 from Zenix/fixTouchMultiPanNotTrigger
This commit is contained in:
commit
4e1d802d9d
@ -797,6 +797,7 @@ void DragEventActuator::OnCollectTouchTarget(const OffsetF& coordinateOffset, co
|
||||
SequencedRecognizer_->SetCoordinateOffset(Offset(coordinateOffset.GetX(), coordinateOffset.GetY()));
|
||||
SequencedRecognizer_->SetOnActionCancel(actionCancel);
|
||||
SequencedRecognizer_->SetGetEventTargetImpl(getEventTargetImpl);
|
||||
SequencedRecognizer_->SetIsEventHandoverNeeded(true);
|
||||
result.emplace_back(SequencedRecognizer_);
|
||||
result.emplace_back(previewLongPressRecognizer_);
|
||||
}
|
||||
|
@ -235,7 +235,8 @@ void SequencedRecognizer::UpdateCurrentIndex()
|
||||
}
|
||||
currentIndex_++;
|
||||
// if the sequence recognizer between long press recognizer, auto send to next event.
|
||||
if (inputEventType_ == InputEventType::MOUSE_BUTTON && CheckBetweenTwoLongPressRecognizer(currentIndex_)) {
|
||||
if (isEventHandoverNeeded_ ||
|
||||
(inputEventType_ == InputEventType::MOUSE_BUTTON && CheckBetweenTwoLongPressRecognizer(currentIndex_))) {
|
||||
auto duration = 0;
|
||||
auto iter = recognizers_.begin();
|
||||
std::advance(iter, currentIndex_ - 1);
|
||||
|
@ -48,6 +48,10 @@ public:
|
||||
|
||||
void CleanRecognizerState() override;
|
||||
void ForceCleanRecognizer() override;
|
||||
void SetIsEventHandoverNeeded(bool isEventHandoverNeeded)
|
||||
{
|
||||
isEventHandoverNeeded_ = isEventHandoverNeeded;
|
||||
}
|
||||
|
||||
private:
|
||||
void HandleTouchDownEvent(const TouchEvent& event) override {};
|
||||
@ -65,6 +69,7 @@ private:
|
||||
void SendTouchEventToNextRecognizer(const RefPtr<NGGestureRecognizer> curRecognizer, int64_t beforeDuration = 0);
|
||||
bool CheckBetweenTwoLongPressRecognizer(int32_t currentIndex = 0);
|
||||
|
||||
bool isEventHandoverNeeded_ = false;
|
||||
int32_t currentIndex_ = 0;
|
||||
AxisEvent lastAxisEvent_;
|
||||
std::list<std::string> childTouchTestList_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user