diff options
author | David Redondo <qt@david-redondo.de> | 2023-03-01 08:47:04 +0100 |
---|---|---|
committer | David Redondo <qt@david-redondo.de> | 2023-03-17 14:45:21 +0100 |
commit | 141d626029776a6b7a6f2fbc29a051221c0742e9 (patch) | |
tree | cfe36f293a22b3b22a1b4170737305b2ee68a356 /src/widgets/kernel/qwidgetrepaintmanager.cpp | |
parent | b538a53a9d2a581c2fddf5dae0a504ef954c3641 (diff) |
Handle device loss for texture widgets
Previously the widget stayed black and we printed
"QBackingStoreDefaultCompositor: the QRhi has changed unexpectedly,
this should not happen".
To make it work the compositor is recreated in addition to the rhi
and the widgets are informed with the internal events.
Change-Id: I982d08bd3530478fe0f827080154c008a92a812e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/widgets/kernel/qwidgetrepaintmanager.cpp')
-rw-r--r-- | src/widgets/kernel/qwidgetrepaintmanager.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp index 16db49f95e..718f904f93 100644 --- a/src/widgets/kernel/qwidgetrepaintmanager.cpp +++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp @@ -1058,7 +1058,11 @@ void QWidgetRepaintManager::flush(QWidget *widget, const QRegion ®ion, QPlatf translucentBackground); widgetWindowPrivate->sendComposeStatus(widget->window(), true); if (flushResult == QPlatformBackingStore::FlushFailedDueToLostDevice) { + qSendWindowChangeToTextureChildrenRecursively(widget->window(), + QEvent::WindowAboutToChangeInternal); store->handle()->graphicsDeviceReportedLost(); + qSendWindowChangeToTextureChildrenRecursively(widget->window(), + QEvent::WindowChangeInternal); widget->update(); } } else { |