diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 5cbeaa863..a8c92f406 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -616,11 +616,11 @@ void AppItem::showPreview() // default: return; // } + showPopupWindow(m_appPreviewTips, true); + m_appPreviewTips->setWindowInfos(m_windowInfos); m_appPreviewTips->updateSnapshots(); m_appPreviewTips->updateLayoutDirection(DockPosition); - - showPopupWindow(m_appPreviewTips, true); } void AppItem::cancelAndHidePreview() diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index f1f6e6a16..d9bff6767 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -87,6 +87,8 @@ void AppSnapshot::compositeChanged() const const bool composite = m_wmHelper->hasComposite(); m_title->setVisible(!composite); + + QTimer::singleShot(1, this, &AppSnapshot::fetchSnapshot); } void AppSnapshot::setWindowInfo(const WindowInfo &info) @@ -214,6 +216,13 @@ void AppSnapshot::paintEvent(QPaintEvent *e) painter.drawImage(offset_x, offset_y, im); } +void AppSnapshot::resizeEvent(QResizeEvent *e) +{ + QWidget::resizeEvent(e); + + QTimer::singleShot(1, this, &AppSnapshot::fetchSnapshot); +} + void AppSnapshot::mousePressEvent(QMouseEvent *e) { QWidget::mousePressEvent(e); diff --git a/frame/item/components/appsnapshot.h b/frame/item/components/appsnapshot.h index d82a21204..5415c1330 100644 --- a/frame/item/components/appsnapshot.h +++ b/frame/item/components/appsnapshot.h @@ -65,6 +65,7 @@ private: void enterEvent(QEvent *e); void leaveEvent(QEvent *e); void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *e); void mousePressEvent(QMouseEvent *e); private: