crash fix:from unloading views

--when as Always Visible view was unloaded from
a CentralLayout because its Activity was closing
it was creating a crash. This patch fixes the
situation by releasing sensitive view signals
earlier.
pull/11/head
Michail Vourlakos 5 years ago
parent fe5dbf9f2b
commit ccbf2c88fd

@ -72,6 +72,14 @@ void GenericLayout::unloadContainments()
<< " ,latteViews in memory ::: " << m_latteViews.size()
<< " ,hidden latteViews in memory ::: " << m_waitingLatteViews.size();
for (const auto view : m_latteViews) {
view->disconnectSensitiveSignals();
}
for (const auto view : m_waitingLatteViews) {
view->disconnectSensitiveSignals();
}
m_unloadedContainmentsIds.clear();
QList<Plasma::Containment *> systrays;

@ -230,6 +230,8 @@ void View::init()
connect(this, &QQuickWindow::heightChanged, this, &View::updateAbsoluteGeometry);
connect(m_corona, &Latte::Corona::availableScreenRectChangedFrom, this, &View::availableScreenRectChangedFrom);
//! used in order to disconnect it when it should NOT be called because it creates crashes
connect(this, &View::availableScreenRegionChangedFrom, m_corona, &Latte::Corona::availableScreenRegionChangedFrom);
connect(this, &View::byPassWMChanged, this, &View::saveConfig);
connect(this, &View::isPreferredForShortcutsChanged, this, &View::saveConfig);
@ -293,6 +295,7 @@ bool View::inDelete() const
void View::disconnectSensitiveSignals()
{
disconnect(m_corona, &Latte::Corona::availableScreenRectChangedFrom, this, &View::availableScreenRectChangedFrom);
disconnect(this, &View::availableScreenRegionChangedFrom, m_corona, &Latte::Corona::availableScreenRegionChangedFrom);
setLayout(nullptr);
if (m_windowsTracker) {
@ -479,7 +482,7 @@ void View::updateAbsoluteGeometry(bool bypassChecks)
if (visibility() && corona() && visibility()->mode() == Types::AlwaysVisible) {
//! main use of BYPASSCKECKS is from Positioner when the view changes screens
emit m_corona->availableScreenRectChangedFrom(this);
emit m_corona->availableScreenRegionChangedFrom(this);
emit availableScreenRegionChangedFrom(this);
}
}

@ -299,6 +299,8 @@ signals:
void availableScreenRectChangedForViewParts();
void customPluginsChanged();
void availableScreenRegionChangedFrom(Latte::View *origin);
private slots:
void availableScreenRectChangedFrom(View *origin);
void configViewCreatedFor(Latte::View *view);

Loading…
Cancel
Save