From 49f462b7f873ecba6bb205697338a4f1eef6d307 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.9 6.8 Fixes: QTBUG-131893 Change-Id: I5d5777e730bee309db21ad5eb65387d19321ee6c Reviewed-by: Volker Hilsheimer --- 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 83e38184936..6ece5d03723 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -2113,7 +2113,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(); }