From 3bf6381837124688ceb445233233514ff3867146 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 18 Jul 2021 22:19:37 +0300 Subject: [PATCH] plasma: remove methods related to removed KWin effects Signed-off-by: Ivailo Monev --- plasma/dialog.cpp | 5 ----- plasma/private/tooltip.cpp | 8 +------ plasma/theme.cpp | 3 --- plasma/windoweffects.cpp | 43 -------------------------------------- plasma/windoweffects.h | 29 +------------------------ 5 files changed, 2 insertions(+), 86 deletions(-) diff --git a/plasma/dialog.cpp b/plasma/dialog.cpp index a4640119..56dd9e11 100644 --- a/plasma/dialog.cpp +++ b/plasma/dialog.cpp @@ -100,7 +100,6 @@ void DialogPrivate::themeChanged() // WA_NoSystemBackground is going to fail combined with sliding popups, but is needed // when we aren't compositing q->setAttribute(Qt::WA_NoSystemBackground, !translucency); - WindowEffects::overrideShadow(q->winId(), !DialogShadows::self()->enabled()); updateMask(); q->update(); } @@ -108,8 +107,6 @@ void DialogPrivate::themeChanged() void DialogPrivate::updateMask() { const bool translucency = Plasma::Theme::defaultTheme()->windowTranslucencyEnabled(); - WindowEffects::enableBlurBehind(q->winId(), translucency, - translucency ? background->mask() : QRegion()); if (translucency) { q->clearMask(); } else { @@ -393,7 +390,6 @@ Dialog::Dialog(QWidget *parent, Qt::WindowFlags f) QPalette pal = palette(); pal.setColor(backgroundRole(), Qt::transparent); setPalette(pal); - WindowEffects::overrideShadow(winId(), !DialogShadows::self()->enabled()); d->adjustViewTimer = new QTimer(this); d->adjustViewTimer->setSingleShot(true); @@ -723,7 +719,6 @@ void Dialog::showEvent(QShowEvent * event) } emit dialogVisible(true); - WindowEffects::overrideShadow(winId(), !DialogShadows::self()->enabled()); DialogShadows::self()->addWindow(this, d->background->enabledBorders()); } diff --git a/plasma/private/tooltip.cpp b/plasma/private/tooltip.cpp index faad5bde..82e1d28e 100644 --- a/plasma/private/tooltip.cpp +++ b/plasma/private/tooltip.cpp @@ -204,7 +204,6 @@ void ToolTip::showEvent(QShowEvent *e) checkSize(); QWidget::showEvent(e); d->preview->setInfo(); - WindowEffects::overrideShadow(winId(), true); } void ToolTip::hideEvent(QHideEvent *e) @@ -337,12 +336,7 @@ void ToolTip::resizeEvent(QResizeEvent *e) { QWidget::resizeEvent(e); d->background->resizeFrame(size()); - if (Plasma::Theme::defaultTheme()->windowTranslucencyEnabled()) { - WindowEffects::enableBlurBehind(winId(), true, d->background->mask()); - clearMask(); - } else { - setMask(d->background->mask()); - } + setMask(d->background->mask()); d->preview->setInfo(); if (isVisible()) { diff --git a/plasma/theme.cpp b/plasma/theme.cpp index c7c9465f..6c96ef02 100644 --- a/plasma/theme.cpp +++ b/plasma/theme.cpp @@ -266,9 +266,6 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo } else if (!compositingActive) { search = QLatin1String("desktoptheme/") + theme + QLatin1String("/opaque/") + image; search = KStandardDirs::locate("data", search); - } else if (WindowEffects::isEffectAvailable(WindowEffects::BlurBehind)) { - search = QLatin1String("desktoptheme/") + theme + QLatin1String("/translucent/") + image; - search = KStandardDirs::locate("data", search); } //not found or compositing enabled diff --git a/plasma/windoweffects.cpp b/plasma/windoweffects.cpp index d7a82743..209e87c6 100644 --- a/plasma/windoweffects.cpp +++ b/plasma/windoweffects.cpp @@ -62,12 +62,6 @@ bool isEffectAvailable(Effect effect) case HighlightWindows: effectName = "_KDE_WINDOW_HIGHLIGHT"; break; - case OverrideShadow: - effectName = "_KDE_SHADOW_OVERRIDE"; - break; - case BlurBehind: - effectName = "_KDE_NET_WM_BLUR_BEHIND_REGION"; - break; default: return false; } @@ -282,43 +276,6 @@ void highlightWindows(WId controller, const QList &ids) #endif } -void overrideShadow(WId window, bool override) -{ -#ifdef Q_WS_X11 - Display *dpy = QX11Info::display(); - Atom atom = XInternAtom( dpy, "_KDE_SHADOW_OVERRIDE", False ); - if (!override) { - XDeleteProperty(dpy, window, atom); - } else { - QVarLengthArray data(1); - data[0] = 1; - XChangeProperty(dpy, window, atom, atom, 32, PropModeReplace, - reinterpret_cast(data.data()), data.size()); - } -#endif -} - -void enableBlurBehind(WId window, bool enable, const QRegion ®ion) -{ -#ifdef Q_WS_X11 - Display *dpy = QX11Info::display(); - Atom atom = XInternAtom(dpy, "_KDE_NET_WM_BLUR_BEHIND_REGION", False); - - if (enable) { - QVector rects = region.rects(); - QVector data; - foreach (const QRect &r, rects) { - data << r.x() << r.y() << r.width() << r.height(); - } - - XChangeProperty(dpy, window, atom, XA_CARDINAL, 32, PropModeReplace, - reinterpret_cast(data.constData()), data.size()); - } else { - XDeleteProperty(dpy, window, atom); - } -#endif -} - } } diff --git a/plasma/windoweffects.h b/plasma/windoweffects.h index 1faea534..f61ed0ec 100644 --- a/plasma/windoweffects.h +++ b/plasma/windoweffects.h @@ -40,9 +40,7 @@ namespace WindowEffects WindowPreview = 2, PresentWindows = 3, PresentWindowsGroup = 4, - HighlightWindows = 5, - OverrideShadow = 6, - BlurBehind = 7 + HighlightWindows = 5 }; /** @@ -125,31 +123,6 @@ namespace WindowEffects * @since 4.4 */ PLASMA_EXPORT void highlightWindows(WId controller, const QList &ids); - - /** - * Forbid te windowmanager to automatically generate a shadow for this window - * @param window the window that won't have shadow - * @param override true if it won't have shadow, false enables it again - * - * @since 4.4 - */ - PLASMA_EXPORT void overrideShadow(WId window, bool override); - - /** - * Instructs the window manager to blur the background in the specified region - * behind the given window. Passing a null region will enable the blur effect - * for the whole window. The region is relative to the top-left corner of the - * client area. - * - * Note that you will usually want to set the region to the shape of the window, - * excluding any shadow or halo. - * - * @param window The window for which to enable the blur effect - * @param enable Enable the effect if @a true, disable it if @false - * @param region The region within the window where the background will be blurred - * @since 4.5 - */ - PLASMA_EXPORT void enableBlurBehind(WId window, bool enable = true, const QRegion ®ion = QRegion()); } } // namespace Plasma