summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetbackingstore.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-10-19 12:30:16 +0200
committerLiang Qi <liang.qi@qt.io>2018-11-11 09:10:42 +0000
commitf018e315fd654dcc0a22209e5a3506b4c8838e1c (patch)
tree0caf67211f5fe836dd179b378612c0a16ebd55da /src/widgets/kernel/qwidgetbackingstore.cpp
parente72613000edc46f3f2b354a698202ac0a4a32fb3 (diff)
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>
Diffstat (limited to 'src/widgets/kernel/qwidgetbackingstore.cpp')
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp7
1 files changed, 7 insertions, 0 deletions
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 &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++)