From b33821736008580ad9b13c005a06d498d4eb1d9a 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. Pick-to: 6.8 Fixes: QTBUG-131893 Change-Id: I5d5777e730bee309db21ad5eb65387d19321ee6c Reviewed-by: Volker Hilsheimer (cherry picked from commit 49f462b7f873ecba6bb205697338a4f1eef6d307) Reviewed-by: Qt Cherry-pick Bot --- 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 54808e9f136..47a801b7251 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -2123,7 +2123,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(); }