mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix(2d): Clicking on the preview will crash
This commit is contained in:
parent
05da78a491
commit
4bb03fa9ae
@ -126,7 +126,9 @@ void FloatingPreview::mouseReleaseEvent(QMouseEvent *e)
|
||||
{
|
||||
QWidget::mouseReleaseEvent(e);
|
||||
|
||||
emit m_tracked->clicked(m_tracked->wid());
|
||||
if (m_tracked) {
|
||||
emit m_tracked->clicked(m_tracked->wid());
|
||||
}
|
||||
}
|
||||
|
||||
bool FloatingPreview::eventFilter(QObject *watched, QEvent *event)
|
||||
@ -139,7 +141,9 @@ bool FloatingPreview::eventFilter(QObject *watched, QEvent *event)
|
||||
|
||||
void FloatingPreview::hideEvent(QHideEvent *event)
|
||||
{
|
||||
m_tracked->setContentsMargins(0, 0, 0, 0);
|
||||
if (m_tracked) {
|
||||
m_tracked->setContentsMargins(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
QWidget::hideEvent(event);
|
||||
}
|
||||
|
@ -186,7 +186,10 @@ void PreviewContainer::enterEvent(QEvent *e)
|
||||
|
||||
m_needActivate = false;
|
||||
m_mouseLeaveTimer->stop();
|
||||
m_waitForShowPreviewTimer->start();
|
||||
|
||||
if (m_wmHelper->hasComposite()) {
|
||||
m_waitForShowPreviewTimer->start();
|
||||
}
|
||||
}
|
||||
|
||||
void PreviewContainer::leaveEvent(QEvent *e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user