1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-05 17:17:49 +03:00

update struts properly for TopLayouts

This commit is contained in:
Michail Vourlakos 2019-04-07 20:15:58 +03:00
parent caedf9842e
commit 385b0e0b20
5 changed files with 21 additions and 1 deletions

View File

@ -133,6 +133,11 @@ void GenericLayout::setBlockAutomaticLatteViewCreation(bool block)
m_blockAutomaticLatteViewCreation = block;
}
bool GenericLayout::isCurrent() const
{
return name() == m_corona->layoutManager()->currentLayoutName();
}
int GenericLayout::viewsCount(int screen) const
{
if (!m_corona) {

View File

@ -71,6 +71,7 @@ public:
void importToCorona();
bool initToCorona(Latte::Corona *corona);
virtual bool isCurrent() const;
bool isWritable() const;
bool layoutIsBroken() const;

View File

@ -36,6 +36,17 @@ TopLayout::~TopLayout()
{
}
bool TopLayout::isCurrent() const
{
for (const auto &layout : m_activeLayouts) {
if (layout->isCurrent()) {
return true;
}
}
return false;
}
const QStringList TopLayout::appliedActivities()
{
if (!m_corona) {

View File

@ -48,6 +48,9 @@ public:
const QStringList appliedActivities();
//! OVERRIDE GeneralLayout implementations
bool isCurrent() const override;
public slots:
void addActiveLayout(ActiveLayout *layout);
void removeActiveLayout(ActiveLayout *layout);

View File

@ -244,7 +244,7 @@ void VisibilityManager::updateStrutsBasedOnLayoutsAndActivities()
{
bool multipleLayoutsAndCurrent = (m_corona->layoutManager()->memoryUsage() == Types::MultipleLayouts
&& m_latteView->managedLayout() && !m_latteView->positioner()->inLocationChangeAnimation()
&& m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName());
&& m_latteView->managedLayout()->isCurrent());
if (m_corona->layoutManager()->memoryUsage() == Types::SingleLayout || multipleLayoutsAndCurrent) {
wm->setViewStruts(*m_latteView, m_viewGeometry, m_latteView->location());