diff options
author | Morten Sørvig <msorvig@trolltech.com> | 2009-07-30 12:19:50 (GMT) |
---|---|---|
committer | Morten Sørvig <msorvig@trolltech.com> | 2009-07-30 12:19:50 (GMT) |
commit | 26e9f4e077c49d1191835def595e4fb70ee50be2 (patch) | |
tree | b2aae6fa449b5ec99c60e2483f84f176d26d4257 /src/gui/kernel | |
parent | d09fa4a816c6b9ccf306b7e1a887c4a4b1dc2f4e (diff) | |
download | Qt-26e9f4e077c49d1191835def595e4fb70ee50be2.zip Qt-26e9f4e077c49d1191835def595e4fb70ee50be2.tar.gz Qt-26e9f4e077c49d1191835def595e4fb70ee50be2.tar.bz2 |
Mac/Carbon: Fix issue causing update(QRegion) to fail on large widgets.
HIViewSetNeedsDisplayInRegion fails on large regions with large
coordinates, fall back on updating the entire region in this case.
The task mentions coordinates outside the range of signed short, but
the provided example demonstrates failures in the 10-20K range as well.
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 70eea3a..3bbf5d4 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3100,7 +3100,12 @@ void QWidgetPrivate::update_sys(const QRegion &rgn) return; dirtyOnWidget += rgn; #ifndef QT_MAC_USE_COCOA - HIViewSetNeedsDisplayInRegion(qt_mac_nativeview_for(q), QMacSmartQuickDrawRegion(rgn.toQDRgn()), true); + RgnHandle rgnHandle = rgn.toQDRgnForUpdate_sys(); + if (rgnHandle) + HIViewSetNeedsDisplayInRegion(qt_mac_nativeview_for(q), QMacSmartQuickDrawRegion(rgnHandle), true); + else { + HIViewSetNeedsDisplay(qt_mac_nativeview_for(q), true); // do a complete repaint on overflow. + } #else // Cocoa doesn't do regions, it seems more efficient to just update the bounding rect instead of a potential number of message passes for each rect. const QRect &boundingRect = rgn.boundingRect(); |