QWidgetBackingStore: Don't flush foreign windows

Foreign windows do not have Qt backingstore content,
and are also not capable of accepting Qt content.

Change-Id: I959c7cdc32e6f4322497e132a436ce7d610a4106
Fixes: QTBUG-71183
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Morten Johan Sørvig 2018-10-19 12:30:16 +02:00 committed by Liang Qi
parent e72613000e
commit f018e315fd
1 changed files with 7 additions and 0 deletions

View File

@ -101,6 +101,13 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
if (tlw->testAttribute(Qt::WA_DontShowOnScreen) || widget->testAttribute(Qt::WA_DontShowOnScreen))
return;
// Foreign Windows do not have backing store content and must not be flushed
if (QWindow *widgetWindow = widget->windowHandle()) {
if (widgetWindow->type() == Qt::ForeignWindow)
return;
}
static bool fpsDebug = qEnvironmentVariableIntValue("QT_DEBUG_FPS");
if (fpsDebug) {
if (!widgetBackingStore->perfFrames++)