1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-09 16:58:16 +03:00

avoid crash in wayland from Widgets Explorer

This commit is contained in:
Michail Vourlakos 2021-01-16 19:41:57 +02:00
parent 84d4d4cef7
commit 754fb85133
2 changed files with 12 additions and 8 deletions

View File

@ -273,7 +273,7 @@ void SubConfigView::setupWaylandIntegration()
return;
}
qDebug() << "wayland primary settings surface was created...";
qDebug() << "wayland " << title() << " surface was created...";
m_shellSurface = interface->createSurface(s, this);
@ -316,7 +316,7 @@ bool SubConfigView::event(QEvent *e)
if (m_shellSurface) {
delete m_shellSurface;
m_shellSurface = nullptr;
qDebug() << "WAYLAND config window surface was deleted...";
qDebug() << "WAYLAND " << title() << " window surface was deleted...";
}
break;

View File

@ -228,12 +228,16 @@ void WidgetExplorerView::hideConfigWindow()
return;
}
if (m_shellSurface) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {
hide();
}
QTimer::singleShot(100, [this]() {
//! avoid crashes under wayland because some mouse events are sended after the surface is destroyed
if (m_shellSurface) {
//!NOTE: Avoid crash in wayland environment with qt5.9
close();
} else {
hide();
}
});
}
void WidgetExplorerView::syncSlideEffect()