plasma: remove methods related to removed KWin effects

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-07-18 22:19:37 +03:00
parent 5652dcb2b7
commit 3bf6381837
5 changed files with 2 additions and 86 deletions

View file

@ -100,7 +100,6 @@ void DialogPrivate::themeChanged()
// WA_NoSystemBackground is going to fail combined with sliding popups, but is needed // WA_NoSystemBackground is going to fail combined with sliding popups, but is needed
// when we aren't compositing // when we aren't compositing
q->setAttribute(Qt::WA_NoSystemBackground, !translucency); q->setAttribute(Qt::WA_NoSystemBackground, !translucency);
WindowEffects::overrideShadow(q->winId(), !DialogShadows::self()->enabled());
updateMask(); updateMask();
q->update(); q->update();
} }
@ -108,8 +107,6 @@ void DialogPrivate::themeChanged()
void DialogPrivate::updateMask() void DialogPrivate::updateMask()
{ {
const bool translucency = Plasma::Theme::defaultTheme()->windowTranslucencyEnabled(); const bool translucency = Plasma::Theme::defaultTheme()->windowTranslucencyEnabled();
WindowEffects::enableBlurBehind(q->winId(), translucency,
translucency ? background->mask() : QRegion());
if (translucency) { if (translucency) {
q->clearMask(); q->clearMask();
} else { } else {
@ -393,7 +390,6 @@ Dialog::Dialog(QWidget *parent, Qt::WindowFlags f)
QPalette pal = palette(); QPalette pal = palette();
pal.setColor(backgroundRole(), Qt::transparent); pal.setColor(backgroundRole(), Qt::transparent);
setPalette(pal); setPalette(pal);
WindowEffects::overrideShadow(winId(), !DialogShadows::self()->enabled());
d->adjustViewTimer = new QTimer(this); d->adjustViewTimer = new QTimer(this);
d->adjustViewTimer->setSingleShot(true); d->adjustViewTimer->setSingleShot(true);
@ -723,7 +719,6 @@ void Dialog::showEvent(QShowEvent * event)
} }
emit dialogVisible(true); emit dialogVisible(true);
WindowEffects::overrideShadow(winId(), !DialogShadows::self()->enabled());
DialogShadows::self()->addWindow(this, d->background->enabledBorders()); DialogShadows::self()->addWindow(this, d->background->enabledBorders());
} }

View file

@ -204,7 +204,6 @@ void ToolTip::showEvent(QShowEvent *e)
checkSize(); checkSize();
QWidget::showEvent(e); QWidget::showEvent(e);
d->preview->setInfo(); d->preview->setInfo();
WindowEffects::overrideShadow(winId(), true);
} }
void ToolTip::hideEvent(QHideEvent *e) void ToolTip::hideEvent(QHideEvent *e)
@ -337,12 +336,7 @@ void ToolTip::resizeEvent(QResizeEvent *e)
{ {
QWidget::resizeEvent(e); QWidget::resizeEvent(e);
d->background->resizeFrame(size()); d->background->resizeFrame(size());
if (Plasma::Theme::defaultTheme()->windowTranslucencyEnabled()) { setMask(d->background->mask());
WindowEffects::enableBlurBehind(winId(), true, d->background->mask());
clearMask();
} else {
setMask(d->background->mask());
}
d->preview->setInfo(); d->preview->setInfo();
if (isVisible()) { if (isVisible()) {

View file

@ -266,9 +266,6 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo
} else if (!compositingActive) { } else if (!compositingActive) {
search = QLatin1String("desktoptheme/") + theme + QLatin1String("/opaque/") + image; search = QLatin1String("desktoptheme/") + theme + QLatin1String("/opaque/") + image;
search = KStandardDirs::locate("data", search); 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 //not found or compositing enabled

View file

@ -62,12 +62,6 @@ bool isEffectAvailable(Effect effect)
case HighlightWindows: case HighlightWindows:
effectName = "_KDE_WINDOW_HIGHLIGHT"; effectName = "_KDE_WINDOW_HIGHLIGHT";
break; break;
case OverrideShadow:
effectName = "_KDE_SHADOW_OVERRIDE";
break;
case BlurBehind:
effectName = "_KDE_NET_WM_BLUR_BEHIND_REGION";
break;
default: default:
return false; return false;
} }
@ -282,43 +276,6 @@ void highlightWindows(WId controller, const QList<WId> &ids)
#endif #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<long, 1> data(1);
data[0] = 1;
XChangeProperty(dpy, window, atom, atom, 32, PropModeReplace,
reinterpret_cast<unsigned char *>(data.data()), data.size());
}
#endif
}
void enableBlurBehind(WId window, bool enable, const QRegion &region)
{
#ifdef Q_WS_X11
Display *dpy = QX11Info::display();
Atom atom = XInternAtom(dpy, "_KDE_NET_WM_BLUR_BEHIND_REGION", False);
if (enable) {
QVector<QRect> rects = region.rects();
QVector<unsigned long> 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<const unsigned char *>(data.constData()), data.size());
} else {
XDeleteProperty(dpy, window, atom);
}
#endif
}
} }
} }

View file

@ -40,9 +40,7 @@ namespace WindowEffects
WindowPreview = 2, WindowPreview = 2,
PresentWindows = 3, PresentWindows = 3,
PresentWindowsGroup = 4, PresentWindowsGroup = 4,
HighlightWindows = 5, HighlightWindows = 5
OverrideShadow = 6,
BlurBehind = 7
}; };
/** /**
@ -125,31 +123,6 @@ namespace WindowEffects
* @since 4.4 * @since 4.4
*/ */
PLASMA_EXPORT void highlightWindows(WId controller, const QList<WId> &ids); PLASMA_EXPORT void highlightWindows(WId controller, const QList<WId> &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 &region = QRegion());
} }
} // namespace Plasma } // namespace Plasma