fix: 修改任务栏图标响应鼠标左键时获取时间戳的方法

在wayland环境下,无法通过QX11Info::getTimestamp()获取到时间戳,
从而导致dock栏应用图标响应鼠标左键的逻辑直接return。

Log: 修复任务栏应用不能通过左键打开的问题
Bug: https://pms.uniontech.com/zentao/bug-view-96031.html
Influence: wayland适配
Change-Id: I4134110069da8fe7db8759efe9a3b30c9b3d535a

# Conflicts:
#	frame/item/appitem.cpp
This commit is contained in:
范朋程 2021-11-05 21:46:46 +08:00
parent f8984e9c61
commit 5aaf8be947
2 changed files with 4 additions and 3 deletions

View File

@ -299,8 +299,9 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e)
return;
}
int curTimestamp = QDateTime::currentSecsSinceEpoch();
if ((curTimestamp - m_lastclickTimes) < 1)
// 获取时间戳qint64转quint64是不存在任何问题的
quint64 curTimestamp = QDateTime::currentDateTime().toMSecsSinceEpoch();
if ((curTimestamp - m_lastclickTimes) < 300)
return;
m_lastclickTimes = curTimestamp;

View File

@ -124,7 +124,7 @@ private:
bool m_active;
int m_retryTimes;
bool m_iconValid;
unsigned long m_lastclickTimes;
quint64 m_lastclickTimes;
WindowInfoMap m_windowInfos;
QString m_id;