From 327dd406e6f74880ff0e6326625d727e55e0110f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 15 Jan 2015 16:09:05 +0100 Subject: [PATCH] Split Client::updateColorScheme into two parts --- client.cpp | 16 +++++++++++++--- client.h | 2 ++ manage.cpp | 3 ++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/client.cpp b/client.cpp index 19f2b4ef81..ceb3cc04a5 100644 --- a/client.cpp +++ b/client.cpp @@ -2299,10 +2299,14 @@ void Client::updateFirstInTabBox() setFirstInTabBox(property.toBool(32, atoms->kde_first_in_window_list)); } -void Client::updateColorScheme() +Xcb::StringProperty Client::fetchColorScheme() const { - // TODO: move into KWindowInfo - QString path = QString::fromUtf8(Xcb::StringProperty(m_client, atoms->kde_color_sheme)); + return Xcb::StringProperty(m_client, atoms->kde_color_sheme); +} + +void Client::readColorScheme(Xcb::StringProperty &property) +{ + QString path = QString::fromUtf8(property); path = rules()->checkDecoColor(path); QPalette p = m_palette; if (!path.isEmpty()) { @@ -2317,6 +2321,12 @@ void Client::updateColorScheme() } } +void Client::updateColorScheme() +{ + Xcb::StringProperty property = fetchColorScheme(); + readColorScheme(property); +} + bool Client::isClient() const { return true; diff --git a/client.h b/client.h index d8726ec2f9..a0619fdf9a 100644 --- a/client.h +++ b/client.h @@ -655,6 +655,8 @@ public: m_firstInTabBox = enable; } void updateFirstInTabBox(); + Xcb::StringProperty fetchColorScheme() const; + void readColorScheme(Xcb::StringProperty &property); void updateColorScheme(); //sets whether the client should be treated as a SessionInteract window diff --git a/manage.cpp b/manage.cpp index 5a3f3f85ba..285dcdec36 100644 --- a/manage.cpp +++ b/manage.cpp @@ -101,6 +101,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) auto skipCloseAnimationCookie = fetchSkipCloseAnimation(); auto gtkFrameExtentsCookie = fetchGtkFrameExtents(); auto showOnScreenEdgeCookie = fetchShowOnScreenEdge(); + auto colorSchemeCookie = fetchColorScheme(); info = new WinInfo(this, m_client, rootWindow(), properties, properties2); // If it's already mapped, ignore hint @@ -635,7 +636,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) updateWindowRules(Rules::All); // Was blocked while !isManaged() setBlockingCompositing(info->isBlockingCompositing()); - updateColorScheme(); + readColorScheme(colorSchemeCookie); readShowOnScreenEdge(showOnScreenEdgeCookie); // TODO: there's a small problem here - isManaged() depends on the mapping state,