diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-08-26 14:57:44 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-08-28 00:46:36 +0200 |
commit | 25026defdc610e2d3d1acee25d2928e6e623dc80 (patch) | |
tree | 21788460d8f60c8092262c73f2167f7ca4940e75 /src/widgets | |
parent | af686f5aef68a3a2d1c04593ef1ca296e29405cd (diff) |
widgets: Clarify QWidgetRepaintManager::sync of specific widget
Change-Id: Ifa2a8245decfcb2b36c1952a39ec60b7eeca6e43
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qwidgetrepaintmanager.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp index 99373f758c..11647ae05e 100644 --- a/src/widgets/kernel/qwidgetrepaintmanager.cpp +++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp @@ -707,9 +707,9 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) /*! Synchronizes the \a exposedRegion of the \a exposedWidget with the backing store. - If there's nothing to repaint, the area is flushed and painting does not occur; - otherwise the area is marked as dirty on screen and will be flushed right after - we are done with all painting. + If there are dirty widgets, including but not limited to the \a exposedWidget, + these will be repainted first. The backingstore is then flushed to the screen, + regardless of whether or not there were any repaints. */ void QWidgetRepaintManager::sync(QWidget *exposedWidget, const QRegion &exposedRegion) { @@ -730,6 +730,9 @@ void QWidgetRepaintManager::sync(QWidget *exposedWidget, const QRegion &exposedR return; } + // As requests to sync a specific widget typically comes from an expose event + // we can't rely solely on our own dirty tracking to decide what to flush, and + // need to respect the platform's request to at least flush the entire widget, QPoint offset = exposedWidget != tlw ? exposedWidget->mapTo(tlw, QPoint()) : QPoint(); markNeedsFlush(exposedWidget, exposedRegion, offset); |