From 853ae953c8dc4a079bf87474a4e010ba655e904f Mon Sep 17 00:00:00 2001 From: tsujan Date: Fri, 15 Nov 2024 13:22:37 +0330 Subject: [PATCH] Check stylesheet before applying Wayland workaround for artifacts (#407) Fixes https://github.com/lxqt/lxqt-notificationd/issues/406 --- src/notification.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/notification.cpp b/src/notification.cpp index ac4013b..a418acf 100644 --- a/src/notification.cpp +++ b/src/notification.cpp @@ -241,7 +241,8 @@ void Notification::paintEvent(QPaintEvent *) #if (QT_VERSION >= QT_VERSION_CHECK(6,8,0)) // NOTE: Starting from Qt 6.8.0, random artifacts are possible in // translucent windows under Wayland. This a workaround. - if (QGuiApplication::platformName() == QStringLiteral("wayland")) + if (QGuiApplication::platformName() == QStringLiteral("wayland") + && testAttribute(Qt::WA_StyleSheetTarget)) { auto origMode = p.compositionMode(); p.setCompositionMode(QPainter::CompositionMode_Clear);