diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index f64265b8f..31a651275 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -39,7 +39,7 @@ const char ThemePrivate::themeRcFile[] = "plasmarc"; // these svgs do not follow the theme's colors, but rather the system colors const char ThemePrivate::systemColorsTheme[] = "internal-system-colors"; #if HAVE_X11 -EffectWatcher *ThemePrivate::s_blurEffectWatcher = 0; +EffectWatcher *ThemePrivate::s_backgroundContrastEffectWatcher = Q_NULLPTR; #endif ThemePrivate *ThemePrivate::globalTheme = 0; @@ -61,7 +61,7 @@ ThemePrivate::ThemePrivate(QObject *parent) cachesToDiscard(NoCache), locolor(false), compositingActive(KWindowSystem::self()->compositingActive()), - blurActive(KWindowEffects::isEffectAvailable(KWindowEffects::BlurBehind)), + backgroundContrastActive(KWindowEffects::isEffectAvailable(KWindowEffects::BackgroundContrast)), isDefault(true), useGlobal(true), hasWallpapers(false), @@ -95,12 +95,17 @@ ThemePrivate::ThemePrivate(QObject *parent) if (QPixmap::defaultDepth() > 8) { #if HAVE_X11 - //watch for blur effect property changes as well - if (!s_blurEffectWatcher) { - s_blurEffectWatcher = new EffectWatcher("_KDE_NET_WM_BLUR_BEHIND_REGION"); + //watch for background contrast effect property changes as well + if (!s_backgroundContrastEffectWatcher) { + s_backgroundContrastEffectWatcher = new EffectWatcher("_KDE_NET_WM_BACKGROUND_CONTRAST_REGION"); } - QObject::connect(s_blurEffectWatcher, SIGNAL(effectChanged(bool)), this, SLOT(blurBehindChanged(bool))); + QObject::connect(s_backgroundContrastEffectWatcher, &EffectWatcher::effectChanged, this, [this](bool active) { + if (backgroundContrastActive != active) { + backgroundContrastActive = active; + scheduleThemeChangeNotification(PixmapCache | SvgElementsCache); + } + }); #endif } QCoreApplication::instance()->installEventFilter(this); @@ -278,7 +283,7 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo type = QStringLiteral("/locolor/"); } else if (!compositingActive) { type = QStringLiteral("/opaque/"); - } else if (blurActive) { + } else if (backgroundContrastActive) { type = QStringLiteral("/translucent/"); } @@ -360,14 +365,6 @@ void ThemePrivate::colorsChanged() scheduleThemeChangeNotification(PixmapCache); } -void ThemePrivate::blurBehindChanged(bool blur) -{ - if (blurActive != blur) { - blurActive = blur; - scheduleThemeChangeNotification(PixmapCache | SvgElementsCache); - } -} - void ThemePrivate::scheduleThemeChangeNotification(CacheTypes caches) { cachesToDiscard |= caches; diff --git a/src/plasma/private/theme_p.h b/src/plasma/private/theme_p.h index 68336f098..5b8f71c01 100644 --- a/src/plasma/private/theme_p.h +++ b/src/plasma/private/theme_p.h @@ -84,7 +84,6 @@ public: public Q_SLOTS: void compositingChanged(bool active); void colorsChanged(); - void blurBehindChanged(bool blur); void settingsFileChanged(const QString &settings); void scheduledCacheUpdate(); void onAppExitCleanup(); @@ -102,7 +101,7 @@ public: static const char systemColorsTheme[]; static const char themeRcFile[]; #if HAVE_X11 - static EffectWatcher *s_blurEffectWatcher; + static EffectWatcher *s_backgroundContrastEffectWatcher; #endif //Ref counting of ThemePrivate instances static ThemePrivate *globalTheme; @@ -142,7 +141,7 @@ public: bool locolor : 1; bool compositingActive : 1; - bool blurActive : 1; + bool backgroundContrastActive : 1; bool isDefault : 1; bool useGlobal : 1; bool hasWallpapers : 1;