fix(dock):fix appicon repeat open many instance

This commit is contained in:
chenzhe 2019-12-23 15:40:40 +08:00 committed by 陈哲
parent 5af3d29355
commit c3d1629ff8
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -113,6 +113,7 @@ private:
bool m_dragging;
bool m_active;
int m_retryTimes;
unsigned long m_lastclickTimes;
WindowInfoMap m_windowInfos;
QString m_id;