From 2858d85281514a70a14ca3b930be6b1d29cf4c0a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 27 Jun 2012 14:02:00 +0200 Subject: Widgets: Apply masks to native windows only. Do not go searching for a parent window handle in setMask_sys() as this causes for example MDI areas to set masks that show the child only. Fix breakage introduced by 8e280d1e187b09651c7036bd76272342d52ce401 . Change-Id: I57de41d16985ebc8d3fc81153a671f2e2807b1eb Reviewed-by: Miikka Heikkinen --- src/widgets/kernel/qwidget_qpa.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 99769b2a9c..25d79fadb5 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -930,22 +930,14 @@ void QWidgetPrivate::registerDropSite(bool on) Q_UNUSED(on); } -void QWidgetPrivate::setMask_sys(const QRegion ®ionIn) +void QWidgetPrivate::setMask_sys(const QRegion ®ion) { if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowMasks)) { qWarning("%s: Not supported on %s.", Q_FUNC_INFO, qPrintable(QGuiApplication::platformName())); return; } Q_Q(QWidget); - QRegion region = regionIn; - QWindow *window = q->windowHandle(); - if (!window) { - if (QWidget *nativeParent = q->nativeParentWidget()) { - window = nativeParent->windowHandle(); - region.translate(q->mapTo(nativeParent, QPoint(0, 0))); - } - } - if (window) + if (const QWindow *window = q->windowHandle()) if (QPlatformWindow *platformWindow = window->handle()) platformWindow->setMask(region); } -- cgit v1.2.3