1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 01:33:50 +03:00

slide-out views when deleted

This commit is contained in:
Michail Vourlakos 2021-04-13 12:46:39 +03:00
parent 02ff6cc808
commit f68aac0501
3 changed files with 18 additions and 8 deletions

View File

@ -758,7 +758,7 @@ void GenericLayout::containmentDestroyed(QObject *cont)
if (view) {
view->disconnectSensitiveSignals();
view->positioner()->hideOnExit();
view->deleteLater();
emit viewEdgeChanged();
@ -904,6 +904,7 @@ void GenericLayout::addView(Plasma::Containment *containment, bool forceOnPrimar
qDebug() << "Rejected explicit latteView and removing it in order add an onPrimary with higher priority at screen: " << connector;
auto viewToDelete = m_latteViews.take(testContainment);
viewToDelete->disconnectSensitiveSignals();
viewToDelete->positioner()->hideOnExit();
viewToDelete->deleteLater();
}
}
@ -1425,6 +1426,7 @@ void GenericLayout::syncLatteViewsToScreens(Layout::ViewsMap *occupiedMap)
auto view = m_latteViews.take(containment);
qDebug() << "syncLatteViewsToScreens: view must be deleted... for containment:" << containment->id() << " at screen:" << view->positioner()->currentScreenName();
view->disconnectSensitiveSignals();
view->positioner()->hideOnExit();
view->deleteLater();
}
@ -1583,6 +1585,7 @@ void GenericLayout::updateView(const Latte::Data::View &viewData)
//! viewMustBeDeleted
m_latteViews.remove(view->containment());
view->disconnectSensitiveSignals();
view->positioner()->hideOnExit();
delete view;
}
}

View File

@ -294,14 +294,8 @@ QString Positioner::currentScreenName() const
return m_screenNameToFollow;
}
void Positioner::onCurrentLayoutIsSwitching(const QString &layoutName)
void Positioner::hideOnExit()
{
if (!m_view || !m_view->layout() || m_view->layout()->name() != layoutName || !m_view->isVisible()) {
return;
}
m_inLayoutUnloading = true;
auto slideLocation = WindowSystem::AbstractWindowInterface::Slide::None;
switch (m_view->containment()->location()) {
@ -330,6 +324,17 @@ void Positioner::onCurrentLayoutIsSwitching(const QString &layoutName)
m_view->setVisible(false);
}
void Positioner::onCurrentLayoutIsSwitching(const QString &layoutName)
{
if (!m_view || !m_view->layout() || m_view->layout()->name() != layoutName || !m_view->isVisible()) {
return;
}
m_inLayoutUnloading = true;
hideOnExit();
}
void Positioner::syncLatteViews()
{
if (m_view->layout()) {

View File

@ -108,6 +108,8 @@ public slots:
//! that might prevent them. It must be called with care.
void immediateSyncGeometry();
void hideOnExit();
void initDelayedSignals();
void updateWaylandId();