From 034bc2fe10faef3bfc508870b076f01ce988cce9 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 5 Dec 2024 21:20:18 +0100 Subject: [PATCH] QWidget: Don't offset the clip region for windows using effects When a top-level widget has a graphic effect applied, QWidgetPrivate::clipToEffectiveMask() must not use the parent widget for the mask calculation as this prevents the loop below from bailing out in the first loop (w->isWindow()) and might mess up the clip region when there is a widget with a mask in the parent chain. Fixes: QTBUG-131893 Change-Id: I5d5777e730bee309db21ad5eb65387d19321ee6c Reviewed-by: Volker Hilsheimer (cherry picked from commit 49f462b7f873ecba6bb205697338a4f1eef6d307) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit b33821736008580ad9b13c005a06d498d4eb1d9a) --- src/widgets/kernel/qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 8a47f8d8c7e..a81400614fc 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -2129,7 +2129,7 @@ void QWidgetPrivate::clipToEffectiveMask(QRegion ®ion) const QPoint offset; #if QT_CONFIG(graphicseffect) - if (graphicsEffect) { + if (graphicsEffect && !w->isWindow()) { w = q->parentWidget(); offset -= data.crect.topLeft(); }