5.13.2: 1st patch by Alberto M (backingstore)

This commit is contained in:
kleuter 2019-11-23 10:09:47 +01:00
parent ae08c2c47c
commit 1b675cbc44
2 changed files with 6 additions and 6 deletions

View File

@ -165,6 +165,12 @@ void QNSWindowBackingStore::flush(QWindow *window, const QRegion &region, const
const QWindow *topLevelWindow = this->window(); const QWindow *topLevelWindow = this->window();
if (window->handle()->isForeignWindow()) {
NSView *view = static_cast<QCocoaWindow *>(window->handle())->view();
NSRect nsRect = NSRectFromCGRect(region.boundingRect().toCGRect());
[view displayRect:nsRect];
return;
}
Q_ASSERT(topLevelWindow->handle() && window->handle()); Q_ASSERT(topLevelWindow->handle() && window->handle());
Q_ASSERT(!topLevelWindow->handle()->isForeignWindow() && !window->handle()->isForeignWindow()); Q_ASSERT(!topLevelWindow->handle()->isForeignWindow() && !window->handle()->isForeignWindow());

View File

@ -107,12 +107,6 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
if (tlw->testAttribute(Qt::WA_DontShowOnScreen) || widget->testAttribute(Qt::WA_DontShowOnScreen)) if (tlw->testAttribute(Qt::WA_DontShowOnScreen) || widget->testAttribute(Qt::WA_DontShowOnScreen))
return; 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"); static bool fpsDebug = qEnvironmentVariableIntValue("QT_DEBUG_FPS");
if (fpsDebug) { if (fpsDebug) {
if (!widgetBackingStore->perfFrames++) if (!widgetBackingStore->perfFrames++)