plasma: Use the new KWindowSystem::compositingChanged() signal
This commit is contained in:
parent
2bf802765d
commit
836b53ff56
23
theme.cpp
23
theme.cpp
@ -97,23 +97,13 @@ public:
|
|||||||
ThemeConfig config;
|
ThemeConfig config;
|
||||||
cacheTheme = config.cacheTheme();
|
cacheTheme = config.cacheTheme();
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
if (QPixmap::defaultDepth() > 8) {
|
||||||
Display *dpy = QX11Info::display();
|
QObject::connect(KWindowSystem::self(), SIGNAL(compositingChanged(bool)), q, SLOT(compositingChanged(bool)));
|
||||||
int screen = DefaultScreen(dpy);
|
|
||||||
locolor = DefaultDepth(dpy, screen) < 16;
|
|
||||||
|
|
||||||
if (!locolor) {
|
|
||||||
char net_wm_cm_name[100];
|
|
||||||
sprintf(net_wm_cm_name, "_NET_WM_CM_S%d", screen);
|
|
||||||
compositeWatch = new KSelectionWatcher(net_wm_cm_name, -1, q);
|
|
||||||
QObject::connect(compositeWatch, SIGNAL(newOwner(Window)), q, SLOT(compositingChanged()));
|
|
||||||
QObject::connect(compositeWatch, SIGNAL(lostOwner()), q, SLOT(compositingChanged()));
|
|
||||||
//watch for blur effect property changes as well
|
//watch for blur effect property changes as well
|
||||||
effectWatcher = 0;
|
effectWatcher = 0;
|
||||||
effectWatcher = new EffectWatcher("_KDE_NET_WM_BLUR_BEHIND_REGION");
|
effectWatcher = new EffectWatcher("_KDE_NET_WM_BLUR_BEHIND_REGION");
|
||||||
QObject::connect(effectWatcher, SIGNAL(blurBehindChanged(bool)), q, SLOT(blurBehindChanged(bool)));
|
QObject::connect(effectWatcher, SIGNAL(blurBehindChanged(bool)), q, SLOT(blurBehindChanged(bool)));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
saveTimer = new QTimer(q);
|
saveTimer = new QTimer(q);
|
||||||
saveTimer->setSingleShot(true);
|
saveTimer->setSingleShot(true);
|
||||||
@ -149,7 +139,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString findInTheme(const QString &image, const QString &theme, bool cache = true);
|
QString findInTheme(const QString &image, const QString &theme, bool cache = true);
|
||||||
void compositingChanged();
|
void compositingChanged(bool active);
|
||||||
void discardCache(CacheTypes caches);
|
void discardCache(CacheTypes caches);
|
||||||
void scheduledCacheUpdate();
|
void scheduledCacheUpdate();
|
||||||
void colorsChanged();
|
void colorsChanged();
|
||||||
@ -274,12 +264,11 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo
|
|||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemePrivate::compositingChanged()
|
void ThemePrivate::compositingChanged(bool active)
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
bool nowCompositingActive = compositeWatch->owner() != None;
|
if (compositingActive != active) {
|
||||||
if (compositingActive != nowCompositingActive) {
|
compositingActive = active;
|
||||||
compositingActive = nowCompositingActive;
|
|
||||||
discardCache(PixmapCache | SvgElementsCache);
|
discardCache(PixmapCache | SvgElementsCache);
|
||||||
emit q->themeChanged();
|
emit q->themeChanged();
|
||||||
}
|
}
|
||||||
|
2
theme.h
2
theme.h
@ -397,7 +397,7 @@ class PLASMA_EXPORT Theme : public QObject
|
|||||||
friend class ThemePrivate;
|
friend class ThemePrivate;
|
||||||
ThemePrivate *const d;
|
ThemePrivate *const d;
|
||||||
|
|
||||||
Q_PRIVATE_SLOT(d, void compositingChanged())
|
Q_PRIVATE_SLOT(d, void compositingChanged(bool))
|
||||||
Q_PRIVATE_SLOT(d, void colorsChanged())
|
Q_PRIVATE_SLOT(d, void colorsChanged())
|
||||||
Q_PRIVATE_SLOT(d, void blurBehindChanged(bool blur))
|
Q_PRIVATE_SLOT(d, void blurBehindChanged(bool blur))
|
||||||
Q_PRIVATE_SLOT(d, void settingsFileChanged(const QString &))
|
Q_PRIVATE_SLOT(d, void settingsFileChanged(const QString &))
|
||||||
|
Loading…
Reference in New Issue
Block a user