summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-29 10:10:22 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-29 10:10:22 +0200
commitf27d8b9f570e7fe5eab527ea13ed8bc3ec172702 (patch)
treed84389d3c2a37b38435e0be5259f48e5f04290e0 /src/widgets
parenta8c98dcb89f2b3f8438555d8febe17d3542d0567 (diff)
parent0d720a000f4f35c5ea6942426efec6847b06f4ce (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwidget.cpp1
-rw-r--r--src/widgets/kernel/qwidget_p.h1
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp18
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp3
-rw-r--r--src/widgets/widgets/qdockwidget.cpp5
5 files changed, 21 insertions, 7 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 3544382944..a4830130f1 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -281,6 +281,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
#endif
#ifndef QT_NO_OPENGL
, renderToTextureReallyDirty(1)
+ , renderToTextureComposeActive(0)
#endif
#if defined(Q_OS_WIN)
, noPaintOnScreen(0)
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 838236536a..71691a4afa 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -750,6 +750,7 @@ public:
#endif
#ifndef QT_NO_OPENGL
uint renderToTextureReallyDirty : 1;
+ uint renderToTextureComposeActive : 1;
#endif
// *************************** Platform specific ************************************
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index bb6f3316d6..03211b4e4c 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -67,6 +67,8 @@ QT_BEGIN_NAMESPACE
extern QRegion qt_dirtyRegion(QWidget *);
+Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList)
+
/**
* Flushes the contents of the \a backingStore into the screen area of \a widget.
* \a tlwOffset is the position of the top level widget relative to the window surface.
@@ -109,6 +111,20 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
offset += widget->mapTo(tlw, QPoint());
#ifndef QT_NO_OPENGL
+ const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive;
+ if (!widgetTextures) {
+ widget->d_func()->renderToTextureComposeActive = false;
+ // Detect the case of falling back to the normal flush path when no
+ // render-to-texture widgets are visible anymore. We will force one
+ // last flush to go through the OpenGL-based composition to prevent
+ // artifacts. The next flush after this one will use the normal path.
+ if (compositionWasActive)
+ widgetTextures = qt_dummy_platformTextureList;
+ } else {
+ widget->d_func()->renderToTextureComposeActive = true;
+ }
+
+ // re-test since we may have been forced to this path via the dummy texture list above
if (widgetTextures) {
qt_window_private(tlw->windowHandle())->compositing = true;
widget->window()->d_func()->sendComposeStatus(widget->window(), false);
@@ -984,8 +1000,6 @@ static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget)
}
}
-Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList)
-
static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
{
foreach (QPlatformTextureList *tl, QWidgetPrivate::get(tlw)->topData()->widgetTextures) {
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index c14fd5a942..ed630913e7 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -2161,6 +2161,9 @@ bool QDockAreaLayoutInfo::updateTabBar() const
if (oldCurrentId > 0 && currentTabId() != oldCurrentId)
that->setCurrentTabId(oldCurrentId);
+ if (QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(tabBar->parent()))
+ dwgw->adjustFlags();
+
//returns if the tabbar is visible or not
return ( (gap ? 1 : 0) + tabBar->count()) > 1;
}
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 19444f8315..8229028dac 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -1392,8 +1392,6 @@ void QDockWidget::changeEvent(QEvent *event)
if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this))
info->updateTabBar();
}
- if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent()))
- p->adjustFlags();
}
#endif // QT_NO_TABBAR
break;
@@ -1483,9 +1481,6 @@ bool QDockWidget::event(QEvent *event)
}
if (!isFloating() && layout != 0 && onTop)
layout->raise(this);
- if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent()))
- p->adjustFlags();
-
break;
}
case QEvent::WindowActivate: