diff --git a/widgetstyle/blurhelper.cpp b/widgetstyle/blurhelper.cpp index 79391f8..c3de7c7 100644 --- a/widgetstyle/blurhelper.cpp +++ b/widgetstyle/blurhelper.cpp @@ -34,6 +34,7 @@ // KDE Frameworks #include +#include // Qt #include @@ -97,6 +98,12 @@ bool BlurHelper::eventFilter(QObject *object, QEvent *event) void BlurHelper::update(QWidget *widget) const { + // KWindowEffects is an X11/EWMH integration. On Wayland there is no X11 + // native interface to pass the blur region to, and calling it can crash + // while a QMenu is being painted. + if (!KWindowSystem::isPlatformX11()) + return; + /* directly from bespin code. Supposedly prevent playing with some 'pseudo-widgets' that have winId matching some other -random- window @@ -122,10 +129,14 @@ void BlurHelper::update(QWidget *widget) const void BlurHelper::enableBlurBehind(QWidget *widget, bool enable, qreal windowRadius) { - if (!widget) + if (!widget || !KWindowSystem::isPlatformX11()) + return; + + const auto native = qGuiApp->nativeInterface(); + if (!native) return; - xcb_connection_t *c = qGuiApp->nativeInterface()->connection(); + xcb_connection_t *c = native->connection(); if (!c) return;