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++)