mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix(dock):fix middle clicked open many instance
This commit is contained in:
parent
ed6c703a75
commit
ff7c85919c
@ -291,6 +291,12 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int curTimestamp = QX11Info::getTimestamp();
|
||||||
|
if ((curTimestamp - m_lastclickTimes) < 300)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_lastclickTimes = curTimestamp;
|
||||||
|
|
||||||
if (e->button() == Qt::MiddleButton) {
|
if (e->button() == Qt::MiddleButton) {
|
||||||
m_itemEntryInter->NewInstance(QX11Info::getTimestamp());
|
m_itemEntryInter->NewInstance(QX11Info::getTimestamp());
|
||||||
|
|
||||||
@ -307,11 +313,6 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
qDebug() << "app item clicked, name:" << m_itemEntryInter->name()
|
qDebug() << "app item clicked, name:" << m_itemEntryInter->name()
|
||||||
<< "id:" << m_itemEntryInter->id() << "my-id:" << m_id << "icon:" << m_itemEntryInter->icon();
|
<< "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());
|
m_itemEntryInter->Activate(QX11Info::getTimestamp());
|
||||||
|
|
||||||
// play launch effect
|
// play launch effect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user