From 3434358acdd52ae1fbf21ce1f61bcfe56df26a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 26 Jan 2016 11:38:11 +0100 Subject: [PATCH] [aurorae] Handle client palette changes When the client's palette changes we need to update the internal colors and emit a colorChanged, so that the decoration can repaint. BUG: 357311 FIXED-IN: 5.5.5 REVIEW: 126891 --- clients/aurorae/src/decorationoptions.cpp | 7 +++++++ clients/aurorae/src/decorationoptions.h | 1 + 2 files changed, 8 insertions(+) diff --git a/clients/aurorae/src/decorationoptions.cpp b/clients/aurorae/src/decorationoptions.cpp index f7b8de5b33..277ebd3ead 100644 --- a/clients/aurorae/src/decorationoptions.cpp +++ b/clients/aurorae/src/decorationoptions.cpp @@ -172,9 +172,16 @@ void DecorationOptions::setDecoration(KDecoration2::Decoration *decoration) disconnect(s.data(), &KDecoration2::DecorationSettings::fontChanged, this, &DecorationOptions::fontChanged); disconnect(s.data(), &KDecoration2::DecorationSettings::decorationButtonsLeftChanged, this, &DecorationOptions::titleButtonsChanged); disconnect(s.data(), &KDecoration2::DecorationSettings::decorationButtonsRightChanged, this, &DecorationOptions::titleButtonsChanged); + disconnect(m_paletteConnection); } m_decoration = decoration; connect(m_decoration->client().data(), &KDecoration2::DecoratedClient::activeChanged, this, &DecorationOptions::slotActiveChanged); + m_paletteConnection = connect(m_decoration->client().data(), &KDecoration2::DecoratedClient::paletteChanged, this, + [this] (const QPalette &pal) { + m_colors.update(pal); + emit colorsChanged(); + } + ); auto s = m_decoration->settings(); connect(s.data(), &KDecoration2::DecorationSettings::fontChanged, this, &DecorationOptions::fontChanged); connect(s.data(), &KDecoration2::DecorationSettings::decorationButtonsLeftChanged, this, &DecorationOptions::titleButtonsChanged); diff --git a/clients/aurorae/src/decorationoptions.h b/clients/aurorae/src/decorationoptions.h index 6606b39eb7..f9013579ee 100644 --- a/clients/aurorae/src/decorationoptions.h +++ b/clients/aurorae/src/decorationoptions.h @@ -244,6 +244,7 @@ private: bool m_active; KDecoration2::Decoration *m_decoration; ColorSettings m_colors; + QMetaObject::Connection m_paletteConnection; }; class Borders : public QObject