From 1b675cbc442eff5777e14e08d18f7b327004e6ef Mon Sep 17 00:00:00 2001 From: kleuter Date: Sat, 23 Nov 2019 10:09:47 +0100 Subject: [PATCH] 5.13.2: 1st patch by Alberto M (backingstore) --- .../src/plugins/platforms/cocoa/qcocoabackingstore.mm | 6 ++++++ 5.13.2/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoabackingstore.mm index 5550f05..b7a1fe9 100644 --- a/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/5.13.2/qtbase/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -165,6 +165,12 @@ void QNSWindowBackingStore::flush(QWindow *window, const QRegion ®ion, const const QWindow *topLevelWindow = this->window(); + if (window->handle()->isForeignWindow()) { + NSView *view = static_cast(window->handle())->view(); + NSRect nsRect = NSRectFromCGRect(region.boundingRect().toCGRect()); + [view displayRect:nsRect]; + return; + } Q_ASSERT(topLevelWindow->handle() && window->handle()); Q_ASSERT(!topLevelWindow->handle()->isForeignWindow() && !window->handle()->isForeignWindow()); diff --git a/5.13.2/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp b/5.13.2/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp index c51527f..ee1107f 100644 --- a/5.13.2/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/5.13.2/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp @@ -107,12 +107,6 @@ 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++)