diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 35ddf4050..f1488321e 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -80,6 +80,7 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) m_dragging(false), m_retryTimes(0), + m_lastclickTimes(0), m_appIcon(QPixmap()), @@ -306,6 +307,11 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e) qDebug() << "app item clicked, name:" << m_itemEntryInter->name() << "id:" << m_itemEntryInter->id() << "my-id:" << m_id << "icon:" << m_itemEntryInter->icon(); + int curTimestamp = QX11Info::getTimestamp(); + if ((curTimestamp - m_lastclickTimes) < 200) + return; + + m_lastclickTimes = curTimestamp; m_itemEntryInter->Activate(QX11Info::getTimestamp()); // play launch effect diff --git a/frame/item/appitem.h b/frame/item/appitem.h index 0e06a435a..7a96d4723 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -113,6 +113,7 @@ private: bool m_dragging; bool m_active; int m_retryTimes; + unsigned long m_lastclickTimes; WindowInfoMap m_windowInfos; QString m_id;