From ae5f440c3393f086a27241b69c4f9dddaf91ce73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 25 Sep 2018 12:25:10 +0200 Subject: macOS: set dpr on pixmap returned by grabWindow() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This matches the behavior of QScreen::grabWindow(), and gives the caller direct access to the scale factor. Change-Id: Ia3ed165a62eaa0f386f8b508ea6b1128ba6be604 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoascreen.mm | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm index f82ef202b1..5b6b2c13be 100644 --- a/src/plugins/platforms/cocoa/qcocoascreen.mm +++ b/src/plugins/platforms/cocoa/qcocoascreen.mm @@ -466,6 +466,7 @@ QPixmap QCocoaScreen::grabWindow(WId window, int x, int y, int width, int height const qreal dpr = devicePixelRatio(); QPixmap windowPixmap(windowSize * dpr); + windowPixmap.setDevicePixelRatio(dpr); windowPixmap.fill(Qt::transparent); for (uint i = 0; i < displayCount; ++i) { -- cgit v1.2.3