From f018e315fd654dcc0a22209e5a3506b4c8838e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 19 Oct 2018 12:30:16 +0200 Subject: QWidgetBackingStore: Don't flush foreign windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/widgets/kernel/qwidgetbackingstore.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index b40c2d12ad..a32eb2a03b 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -101,6 +101,13 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, 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++) -- cgit v1.2.3