Widgets: Apply masks to native windows only.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Wed, 27 Jun 2012 12:02:00 +0000 (14:02 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 27 Jun 2012 12:43:00 +0000 (14:43 +0200)
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 <miikka.heikkinen@digia.com>
src/widgets/kernel/qwidget_qpa.cpp

index 99769b2..25d79fa 100644 (file)
@@ -930,22 +930,14 @@ void QWidgetPrivate::registerDropSite(bool on)
     Q_UNUSED(on);
 }
 
-void QWidgetPrivate::setMask_sys(const QRegion &regionIn)
+void QWidgetPrivate::setMask_sys(const QRegion &region)
 {
     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);
 }