From 98c789eb0fb36493254d60cddce4a1eaa6a1665b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 25 Sep 2018 12:54:09 +0200 Subject: macOS: Make QScreen::grabWindow() work again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/cocoa/qcocoascreen.mm | 4 ++-- 1 file 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; -- cgit v1.2.3