File libqt5-clamp-dirty-region-to-window-size.patch of Package libqt5-qtbase.1959

From b6503d17955520fc4d4c598993ffe8a94b7fa20f Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Date: Wed, 9 Dec 2015 10:50:40 +0100
Subject: [PATCH] QWidgetBackingStore::markDirty(): Clamp dirty region to
 window size.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Graphics effects may exceed the window size, causing platform
backing store operations to fail (see QWidgetPrivate::effectiveRectFor()).

Task-number: QTBUG-49785
Change-Id: Iff16da599397d19acb86010fe7023f3ce15b6d6f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
---
 src/widgets/kernel/qwidgetbackingstore.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 1718700..3f7f929 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -641,7 +641,11 @@ void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget,
 
 
     const QRect widgetRect = widget->d_func()->effectiveRectFor(rect);
-    const QRect translatedRect(widgetRect.translated(widget->mapTo(tlw, QPoint())));
+    QRect translatedRect = widgetRect;
+    if (widget != tlw)
+        translatedRect.translate(widget->mapTo(tlw, QPoint()));
+    // Graphics effects may exceed window size, clamp.
+    translatedRect = translatedRect.intersected(QRect(QPoint(), tlw->size()));
     if (qt_region_strictContains(dirty, translatedRect)) {
         if (updateTime == UpdateNow)
             sendUpdateRequest(tlw, updateTime);
-- 
2.6.4