summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2011-08-22 13:16:34 (GMT)
committerSergio Ahumada <sergio.ahumada@nokia.com>2011-08-22 13:46:27 (GMT)
commitc5f46907fbc0354aacc4bc4a6f5ab97c8b656d1a (patch)
treea903c66f5db604ed750e611fddb5984c9b4f0b31 /src/gui
parente828368117ea34bbeac60e910dea170e868a82c3 (diff)
downloadQt-c5f46907fbc0354aacc4bc4a6f5ab97c8b656d1a.zip
Qt-c5f46907fbc0354aacc4bc4a6f5ab97c8b656d1a.tar.gz
Qt-c5f46907fbc0354aacc4bc4a6f5ab97c8b656d1a.tar.bz2
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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qpixmap_mac.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp
index 8d72a59..3afc724 100644
--- a/src/gui/image/qpixmap_mac.cpp
+++ b/src/gui/image/qpixmap_mac.cpp
@@ -857,9 +857,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);