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