Split Client::updateColorScheme into two parts
This commit is contained in:
parent
a55c7ba0d5
commit
327dd406e6
3 changed files with 17 additions and 4 deletions
16
client.cpp
16
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;
|
||||
|
|
2
client.h
2
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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue