macOS: set dpr on pixmap returned by grabWindow()

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ø <tor.arne.vestbo@qt.io>
bb10
Morten Johan Sørvig 2018-09-25 12:25:10 +02:00 committed by Liang Qi
parent 8802826de6
commit ae5f440c33
1 changed files with 1 additions and 0 deletions

View File

@ -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) {