summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-09-25 12:54:09 +0200
committerLiang Qi <liang.qi@qt.io>2018-11-11 09:10:12 +0000
commit98c789eb0fb36493254d60cddce4a1eaa6a1665b (patch)
tree6873bab2dcc55f0908a962193e824ad628adf280
parentae5f440c3393f086a27241b69c4f9dddaf91ce73 (diff)
macOS: Make QScreen::grabWindow() work again
Commit 17b73b0d2b8 introduced a regression where the grab rect position was added to the size when bounding to the display size. This is incorrect. Change-Id: I11d7ba7f53b96badfdead190ef9ddb525ed4ba99 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
index 5b6b2c13be..0d6567070e 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.mm
+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
@@ -474,8 +474,8 @@ QPixmap QCocoaScreen::grabWindow(WId window, int x, int y, int width, int height
// Calculate the position and size of the requested area
QPoint pos(qAbs(bounds.origin.x - x), qAbs(bounds.origin.y - y));
- QSize size(qMin(pos.x() + width, qRound(bounds.size.width)),
- qMin(pos.y() + height, qRound(bounds.size.height)));
+ QSize size(qMin(width, qRound(bounds.size.width)),
+ qMin(height, qRound(bounds.size.height)));
pos *= dpr;
size *= dpr;