Skip to content

Commit

Permalink
fix(preview): cannot switch preview window
Browse files Browse the repository at this point in the history
taskID=5186
  • Loading branch information
justforlxz committed May 29, 2019
1 parent 95aad7e commit 82d6b4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions frame/item/components/appsnapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ void AppSnapshot::leaveEvent(QEvent *e)

m_closeBtn2D->setVisible(false);

emit leaved(wid());

update();
}

Expand Down
1 change: 0 additions & 1 deletion frame/item/components/appsnapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
11 changes: 8 additions & 3 deletions frame/item/components/previewcontainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -187,6 +186,7 @@ void PreviewContainer::enterEvent(QEvent *e)

m_needActivate = false;
m_mouseLeaveTimer->stop();
m_waitForShowPreviewTimer->start();
}

void PreviewContainer::leaveEvent(QEvent *e)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 82d6b4b

Please sign in to comment.