Guard against null-nativeParent in QWidgetBackingStore::markDirtyOnScreen

The back port in 1e310b5a4508f removed the check in two of the call sites
for this function, that in 5.14 were handled elsewhere, but for 5.12 caused
us to not guard against null-nativeParent windows anymore.

Change-Id: I698c5a0b6a54bbee37b533fcafa75129768c5db1
Fixes: QTBUG-81315
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-01-13 14:41:28 +01:00
parent bdccc51bc1
commit 07c33ab76f

View File

@ -717,7 +717,11 @@ void QWidgetBackingStore::markDirtyOnScreen(const QRegion &region, QWidget *widg
// Alien widgets. // Alien widgets.
if (!hasPlatformWindow(widget) && !widget->isWindow()) { if (!hasPlatformWindow(widget) && !widget->isWindow()) {
QWidget *nativeParent = widget->nativeParentWidget(); // Alien widgets with the top-level as the native parent (common case). QWidget *nativeParent = widget->nativeParentWidget();
if (!nativeParent)
return;
// Alien widgets with the top-level as the native parent (common case).
if (nativeParent == tlw) { if (nativeParent == tlw) {
dirtyOnScreen += region.translated(topLevelOffset); dirtyOnScreen += region.translated(topLevelOffset);
return; return;