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
parent
20e2fd074a
commit
2858d85281
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue