From 5e9886fa97ab413d32b22f47134029fbe492f9c8 Mon Sep 17 00:00:00 2001 From: listenerri Date: Fri, 30 Nov 2018 17:47:08 +0800 Subject: [PATCH] fix: click item is ignored Change-Id: I7ef7f440d59bb7a75ad50d5a9c85f6084c4704bf --- frame/item/appitem.cpp | 2 +- frame/item/pluginsitem.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 65da949bd..cf5478f75 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -295,7 +295,7 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e) playSwingEffect(); } else if (e->button() == Qt::LeftButton) { - if (checkAndResetTapHoldGestureState()) { + if (checkAndResetTapHoldGestureState() && e->source() == Qt::MouseEventSynthesizedByQt) { qDebug() << "tap and hold gesture detected, ignore the synthesized mouse release event"; return; } diff --git a/frame/item/pluginsitem.cpp b/frame/item/pluginsitem.cpp index 3d55cde9e..7c22e2521 100644 --- a/frame/item/pluginsitem.cpp +++ b/frame/item/pluginsitem.cpp @@ -149,7 +149,7 @@ void PluginsItem::mouseReleaseEvent(QMouseEvent *e) if (e->button() != Qt::LeftButton) return; - if (checkAndResetTapHoldGestureState()) { + if (checkAndResetTapHoldGestureState()&& e->source() == Qt::MouseEventSynthesizedByQt) { qDebug() << "tap and hold gesture detected, ignore the synthesized mouse release event"; return; }