From 5aaf8be947540fbf39b6aece3c6ed4c04bb86c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=9C=8B=E7=A8=8B?= Date: Fri, 5 Nov 2021 21:46:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A0=8F=E5=9B=BE=E6=A0=87=E5=93=8D=E5=BA=94=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E5=B7=A6=E9=94=AE=E6=97=B6=E8=8E=B7=E5=8F=96=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在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 --- frame/item/appitem.cpp | 5 +++-- frame/item/appitem.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index d294c6861..7d9f732fa 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -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; diff --git a/frame/item/appitem.h b/frame/item/appitem.h index d9d726836..3c5b83ec9 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -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;