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 8e280d1e18 .

Change-Id: I57de41d16985ebc8d3fc81153a671f2e2807b1eb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
bb10
Friedemann Kleint 2012-06-27 14:02:00 +02:00 committed by Qt by Nokia
parent 20e2fd074a
commit 2858d85281
1 changed files with 2 additions and 10 deletions

View 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);
}