summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qbackingstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qbackingstore.cpp')
-rw-r--r--src/gui/painting/qbackingstore.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 8d71d1c3a9..0dfb52e7c3 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -192,6 +192,17 @@ void QBackingStore::endPaint()
d_ptr->platformBackingStore->endPaint();
}
+static bool isRasterSurface(QWindow *window)
+{
+ switch (window->surfaceType()) {
+ case QSurface::RasterSurface:
+ case QSurface::RasterGLSurface:
+ return true;
+ default:
+ return false;
+ };
+}
+
/*!
Flushes the given \a region from the specified \a window onto the
screen.
@@ -220,6 +231,13 @@ void QBackingStore::flush(const QRegion &region, QWindow *window, const QPoint &
return;
}
+ if (!isRasterSurface(window)) {
+ qWarning() << "Attempted flush to non-raster surface" << window << "of type" << window->surfaceType()
+ << (window->inherits("QWidgetWindow") ? "(consider using Qt::WA_PaintOnScreen to exclude "
+ "from backingstore sync)" : "");
+ return;
+ }
+
#ifdef QBACKINGSTORE_DEBUG
if (window && window->isTopLevel() && !qt_window_private(window)->receivedExpose) {
qWarning().nospace() << "QBackingStore::flush() called with non-exposed window "