[aurorae] Make QML-based decoration themes react to border size changes

Summary:
Currently only SVG-based decoration themes react to border size changes.
QML-based decoration themes on the other hand, for example Plastik, don't
react to such changes, only new windows will have decorations with the
new border size.

BUG: 408035

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22665
This commit is contained in:
Vlad Zagorodniy 2019-07-29 21:22:52 +03:00
parent 702a4ff688
commit 53936854c7

View file

@ -306,7 +306,6 @@ void Decoration::init()
const KConfigGroup themeGroup(conf, m_themeName.mid(16));
theme->setButtonSize((KDecoration2::BorderSize)(themeGroup.readEntry<int>("ButtonSize",
int(KDecoration2::BorderSize::Normal) - s_indexMapper) + s_indexMapper));
updateBorders();
};
connect(this, &Decoration::configChanged, theme, readButtonSize);
readButtonSize();
@ -404,6 +403,18 @@ void Decoration::init()
}
}
setupBorders(m_item);
// TODO: Is there a more efficient way to react to border changes?
auto trackBorders = [this](KWin::Borders *borders) {
if (!borders) {
return;
}
connect(borders, &KWin::Borders::leftChanged, this, &Decoration::updateBorders);
connect(borders, &KWin::Borders::rightChanged, this, &Decoration::updateBorders);
connect(borders, &KWin::Borders::topChanged, this, &Decoration::updateBorders);
connect(borders, &KWin::Borders::bottomChanged, this, &Decoration::updateBorders);
};
trackBorders(m_borders);
trackBorders(m_maximizedBorders);
if (m_extendedBorders) {
auto updateExtendedBorders = [this] {
setResizeOnlyBorders(*m_extendedBorders);