diff --git a/shell/panelview.h b/shell/panelview.h --- a/shell/panelview.h +++ b/shell/panelview.h @@ -191,7 +191,6 @@ void showConfigurationInterface(Plasma::Applet *applet) override; private Q_SLOTS: - void themeChanged(); void positionPanel(); void restore(); void setAutoHideEnabled(bool autoHideEnabled); diff --git a/shell/panelview.cpp b/shell/panelview.cpp --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -77,8 +77,8 @@ setColor(QColor(Qt::transparent)); setFlags(Qt::FramelessWindowHint|Qt::WindowDoesNotAcceptFocus); - connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelView::themeChanged); - connect(this, SIGNAL(backgroundHintsChanged()), this, SLOT(themeChanged())); + connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelView::updateMask); + connect(this, &PanelView::backgroundHintsChanged, this, &PanelView::updateMask); // TODO: add finished/componentComplete signal to QuickViewSharedEngine, // so we exactly know when rootobject is available connect(this, &QuickViewSharedEngine::statusChanged, @@ -746,7 +746,7 @@ void PanelView::integrateScreen() { connect(m_screenToFollow.data(), &QScreen::geometryChanged, this, &PanelView::restore); - themeChanged(); + updateMask(); KWindowSystem::setOnAllDesktops(winId(), true); KWindowSystem::setType(winId(), NET::Dock); if (m_shellSurface) { @@ -960,17 +960,33 @@ void PanelView::updateMask() { - QRegion mask; + if (m_backgroundHints == Plasma::Types::NoBackground) { + KWindowEffects::enableBlurBehind(winId(), false); + KWindowEffects::enableBackgroundContrast(winId(), false); + } else { + QRegion mask; - QQuickItem *rootObject = this->rootObject(); - if (rootObject) { - const QVariant maskProperty = rootObject->property("panelMask"); - if (static_cast(maskProperty.type()) == QMetaType::QRegion) { - mask = maskProperty.value(); + QQuickItem *rootObject = this->rootObject(); + if (rootObject) { + const QVariant maskProperty = rootObject->property("panelMask"); + if (static_cast(maskProperty.type()) == QMetaType::QRegion) { + mask = maskProperty.value(); + } } - } - setMask(mask); + KWindowEffects::enableBlurBehind(winId(), m_theme.blurBehindEnabled(), mask); + KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(), + m_theme.backgroundContrast(), + m_theme.backgroundIntensity(), + m_theme.backgroundSaturation(), + mask); + + if (KWindowSystem::compositingActive()) { + setMask(QRegion()); + } else { + setMask(mask); + } + } } bool PanelView::canSetStrut() const @@ -1112,24 +1128,6 @@ } -void PanelView::themeChanged() -{ - if (m_backgroundHints == Plasma::Types::NoBackground) { - KWindowEffects::enableBlurBehind(winId(), false); - KWindowEffects::enableBackgroundContrast(winId(), false); - } else { - KWindowEffects::enableBlurBehind(winId(), m_theme.blurBehindEnabled()); - KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(), - m_theme.backgroundContrast(), - m_theme.backgroundIntensity(), - m_theme.backgroundSaturation()); - } - -#if PLASMA_VERSION < QT_VERSION_CHECK(5,59,0) - updateMask(); -#endif -} - void PanelView::containmentChanged() { restore();