widgetexplorer:delete on each hiding

work/spdx
Michail Vourlakos 4 years ago
parent 53827549d7
commit 1e487a4b1c

@ -19,6 +19,7 @@
#include "viewsettingsfactory.h" #include "viewsettingsfactory.h"
// local
#include "primaryconfigview.h" #include "primaryconfigview.h"
#include "widgetexplorerview.h" #include "widgetexplorerview.h"
#include "../view.h" #include "../view.h"
@ -38,10 +39,6 @@ ViewSettingsFactory::~ViewSettingsFactory()
if (m_primaryConfigView) { if (m_primaryConfigView) {
delete m_primaryConfigView; delete m_primaryConfigView;
} }
if (m_widgetExplorerView) {
delete m_widgetExplorerView;
}
} }
bool ViewSettingsFactory::hasOrphanSettings() const bool ViewSettingsFactory::hasOrphanSettings() const
@ -88,13 +85,9 @@ ViewPart::PrimaryConfigView *ViewSettingsFactory::primaryConfigView(Latte::View
ViewPart::WidgetExplorerView *ViewSettingsFactory::widgetExplorerView(Latte::View *view) ViewPart::WidgetExplorerView *ViewSettingsFactory::widgetExplorerView(Latte::View *view)
{ {
if (!m_widgetExplorerView) { //! it is deleted on hiding
m_widgetExplorerView = new ViewPart::WidgetExplorerView(view); auto widgetExplorerView = new ViewPart::WidgetExplorerView(view);
} else { return widgetExplorerView;
m_widgetExplorerView->setParentView(view);
}
return m_widgetExplorerView;
} }

@ -60,7 +60,6 @@ public:
private: private:
QPointer<ViewPart::PrimaryConfigView> m_primaryConfigView; QPointer<ViewPart::PrimaryConfigView> m_primaryConfigView;
QPointer<ViewPart::WidgetExplorerView> m_widgetExplorerView;
QPointer<Plasma::Containment> m_lastContainment; QPointer<Plasma::Containment> m_lastContainment;
}; };

@ -230,7 +230,9 @@ void WidgetExplorerView::hideConfigWindow()
return; 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 //! avoid crashes under wayland because some mouse events are sended after the surface is destroyed
if (m_shellSurface) { if (m_shellSurface) {
@ -239,7 +241,7 @@ void WidgetExplorerView::hideConfigWindow()
} else { } else {
hide(); hide();
} }
}); });*/
} }
void WidgetExplorerView::syncSlideEffect() void WidgetExplorerView::syncSlideEffect()

Loading…
Cancel
Save