diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index b64181e4b..851aadd82 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -214,8 +214,6 @@ void AppSnapshot::leaveEvent(QEvent *e) m_closeBtn2D->setVisible(false); - emit leaved(wid()); - update(); } diff --git a/frame/item/components/appsnapshot.h b/frame/item/components/appsnapshot.h index 77cb870c8..52bfcea7d 100644 --- a/frame/item/components/appsnapshot.h +++ b/frame/item/components/appsnapshot.h @@ -58,7 +58,6 @@ class AppSnapshot : public QWidget signals: void entered(const WId wid) const; - void leaved(const WId wid) const; void clicked(const WId wid) const; void requestCheckWindow() const; diff --git a/frame/item/components/previewcontainer.cpp b/frame/item/components/previewcontainer.cpp index b5ff1f299..316d03514 100644 --- a/frame/item/components/previewcontainer.cpp +++ b/frame/item/components/previewcontainer.cpp @@ -169,8 +169,7 @@ void PreviewContainer::appendSnapWidget(const WId wid) connect(snap, &AppSnapshot::clicked, this, &PreviewContainer::onSnapshotClicked, Qt::QueuedConnection); connect(snap, &AppSnapshot::entered, this, &PreviewContainer::previewEntered, Qt::QueuedConnection); - connect(snap, &AppSnapshot::requestCheckWindow, this, &PreviewContainer::requestCheckWindows); - connect(snap, &AppSnapshot::leaved, m_waitForShowPreviewTimer, &QTimer::stop); + connect(snap, &AppSnapshot::requestCheckWindow, this, &PreviewContainer::requestCheckWindows, Qt::QueuedConnection); m_windowListLayout->addWidget(snap); @@ -187,6 +186,7 @@ void PreviewContainer::enterEvent(QEvent *e) m_needActivate = false; m_mouseLeaveTimer->stop(); + m_waitForShowPreviewTimer->start(); } void PreviewContainer::leaveEvent(QEvent *e) @@ -246,7 +246,12 @@ void PreviewContainer::previewEntered(const WId wid) m_currentWId = wid; m_floatingPreview->trackWindow(snap); - m_waitForShowPreviewTimer->start(); + + if (m_waitForShowPreviewTimer->isActive()) { + return; + } + + previewFloating(); } void PreviewContainer::previewFloating()