From 54152e1fc726ed9142b253766ba2d9c705a84e5d Mon Sep 17 00:00:00 2001 From: kleuter Date: Fri, 21 Dec 2018 22:53:05 +0100 Subject: [PATCH] qwidgetbackingstore.cpp from 5.12.1 --- .../widgets/kernel/qwidgetbackingstore.cpp | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/5.12.0/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp b/5.12.0/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp index 53769ef..a32eb2a 100644 --- a/5.12.0/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/5.12.0/qtbase/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++) @@ -1053,20 +1060,8 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) static bool switchableWidgetComposition = QGuiApplicationPrivate::instance()->platformIntegration() ->hasCapability(QPlatformIntegration::SwitchableWidgetComposition); - if (!switchableWidgetComposition -// The Windows compositor handles fullscreen OpenGL window specially. Besides -// having trouble with popups, it also has issues with flip-flopping between -// OpenGL-based and normal flushing. Therefore, stick with GL for fullscreen -// windows (QTBUG-53515). Similary, translucent windows should not switch to -// layered native windows (QTBUG-54734). -#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !defined(Q_OS_WINCE) - || tlw->windowState().testFlag(Qt::WindowFullScreen) - || tlw->testAttribute(Qt::WA_TranslucentBackground) -#endif - ) - { + if (!switchableWidgetComposition) return qt_dummy_platformTextureList(); - } } return 0;