diff options
author | Andy Shaw <andy.shaw@digia.com> | 2011-08-22 15:16:34 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-12 16:03:47 +0200 |
commit | baf2b1f9b2c533da4bf543833ef1905392fc8dab (patch) | |
tree | 16435c3e8f21b43a00fd0d63feefd99ca150a897 | |
parent | 560e68e2bd470e2f4d4353b4100729f15efc666f (diff) |
Fix problem with grabWindow on Mac OS X 10.6 with Cocoa
For some reason the test did not fail locally but fails in the CI
system. A manual check of the images from the test shows it should
have failed. Reason for this will be investigated separately
Reviewed-by: Sergio Ahumada
(cherry picked from commit c5f46907fbc0354aacc4bc4a6f5ab97c8b656d1a)
Change-Id: I15f09649bb37dd97401926eb5e52f33748e11ec0
Reviewed-on: http://codereview.qt-project.org/4668
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
-rw-r--r-- | src/gui/image/qpixmap_mac.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 5f5d14998b..47b6eef761 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -868,9 +868,8 @@ static QPixmap qt_mac_grabScreenRect_10_6(const QRect &rect) const CGRect bounds = CGDisplayBounds(displays[i]); // Translate to display-local coordinates QRect displayRect = rect.translated(qRound(-bounds.origin.x), qRound(-bounds.origin.y)); - // Adjust for inverted y axis. - displayRect.moveTop(qRound(bounds.size.height) - displayRect.y() - rect.height()); - QCFType<CGImageRef> image = CGDisplayCreateImageForRect(displays[i], bounds); + QCFType<CGImageRef> image = CGDisplayCreateImageForRect(displays[i], + CGRectMake(displayRect.x(), displayRect.y(), displayRect.width(), displayRect.height())); QPixmap pix = QPixmap::fromMacCGImageRef(image); QPainter painter(&windowPixmap); painter.drawPixmap(-bounds.origin.x, -bounds.origin.y, pix); |