Use setImage workaround on all OS X versions.
authorMorten Johan Sørvig <morten.sorvig@digia.com>
Fri, 16 Nov 2012 06:09:03 +0000 (07:09 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 20 Nov 2012 07:49:19 +0000 (08:49 +0100)
The painting bug that we are working around/fixing
here has been observed on 10.7 as well.

Change-Id: Ic29421bcc84405afa085af2f0ed2bc554c684f98
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
src/plugins/platforms/cocoa/qcocoabackingstore.mm

index ef67275..8a20ed8 100644 (file)
@@ -73,12 +73,9 @@ void QCocoaBackingStore::flush(QWindow *widget, const QRegion &region, const QPo
     NSRect rect = NSMakeRect(geo.x(), geo.y(), geo.width(), geo.height());
     QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window()->handle());
     if (cocoaWindow) {
-        if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) {
-            // Workaround for malfunctioning displayRect on 10.8 where
-            // calling it seems to have no effect. Call setImage like
-            // resize() does.
-            [cocoaWindow->m_contentView setImage:m_image];
-        }
+        // setImage call is needed here to make the displayRect call
+        // have effect - even if the image has not changed.
+        [cocoaWindow->m_contentView setImage:m_image];
         [cocoaWindow->m_contentView displayRect:rect];
    }
 }