diff --git a/app/view/settings/viewsettingsfactory.cpp b/app/view/settings/viewsettingsfactory.cpp index 94353bc42..4395c553d 100644 --- a/app/view/settings/viewsettingsfactory.cpp +++ b/app/view/settings/viewsettingsfactory.cpp @@ -19,6 +19,7 @@ #include "viewsettingsfactory.h" +// local #include "primaryconfigview.h" #include "widgetexplorerview.h" #include "../view.h" @@ -38,10 +39,6 @@ ViewSettingsFactory::~ViewSettingsFactory() if (m_primaryConfigView) { delete m_primaryConfigView; } - - if (m_widgetExplorerView) { - delete m_widgetExplorerView; - } } bool ViewSettingsFactory::hasOrphanSettings() const @@ -88,13 +85,9 @@ ViewPart::PrimaryConfigView *ViewSettingsFactory::primaryConfigView(Latte::View ViewPart::WidgetExplorerView *ViewSettingsFactory::widgetExplorerView(Latte::View *view) { - if (!m_widgetExplorerView) { - m_widgetExplorerView = new ViewPart::WidgetExplorerView(view); - } else { - m_widgetExplorerView->setParentView(view); - } - - return m_widgetExplorerView; + //! it is deleted on hiding + auto widgetExplorerView = new ViewPart::WidgetExplorerView(view); + return widgetExplorerView; } diff --git a/app/view/settings/viewsettingsfactory.h b/app/view/settings/viewsettingsfactory.h index 799ca4f95..f4ae6f8c5 100644 --- a/app/view/settings/viewsettingsfactory.h +++ b/app/view/settings/viewsettingsfactory.h @@ -60,7 +60,6 @@ public: private: QPointer m_primaryConfigView; - QPointer m_widgetExplorerView; QPointer m_lastContainment; }; diff --git a/app/view/settings/widgetexplorerview.cpp b/app/view/settings/widgetexplorerview.cpp index ed9c4000d..b65acf58c 100644 --- a/app/view/settings/widgetexplorerview.cpp +++ b/app/view/settings/widgetexplorerview.cpp @@ -230,7 +230,9 @@ void WidgetExplorerView::hideConfigWindow() return; } - QTimer::singleShot(100, [this]() { + deleteLater(); + + /*QTimer::singleShot(100, [this]() { //! avoid crashes under wayland because some mouse events are sended after the surface is destroyed if (m_shellSurface) { @@ -239,7 +241,7 @@ void WidgetExplorerView::hideConfigWindow() } else { hide(); } - }); + });*/ } void WidgetExplorerView::syncSlideEffect()