Split Client::updateColorScheme into two parts

icc-effect-5.14.5
Martin Gräßlin 2015-01-15 16:09:05 +01:00
parent a55c7ba0d5
commit 327dd406e6
3 changed files with 17 additions and 4 deletions

View File

@ -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;

View File

@ -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

View File

@ -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,