From dccded7c80df4b7f80d3b0121b1f5ced25bd6848 Mon Sep 17 00:00:00 2001 From: reionwong Date: Sun, 30 Aug 2026 11:30:25 -0400 Subject: [PATCH] fix(widgetstyle): skip the X11 blur helper on Wayland --- widgetstyle/blurhelper.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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;