From 9b965f3fa0899e27667aba4c437206fdf7a14969 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 22 Oct 2014 10:27:46 +0200 Subject: Fix disfunctional QQuickRenderControl with multiple screens Having a retina and non-retina screen connected resulted in getting no output from QQuickRenderControl and QQuickWidget on the non-retina screen. This is caused by the fact that Quick is blindly calling QWindow::devicePixelRatio(). This approach is wrong when using QQuickRenderControl since the QQuickWindow does not have an actual native window and so devicePixelRatio() merely returns some default value which will definitely be wrong for one of the screens. The patch fixes the problem by introducing QQuickWindow::effectiveDevicePixelRatio(), which, via QQuickRenderControl::renderWindowFor, supports the redirected case too. Task-number: QTBUG-42114 Change-Id: I057e01f0a00758dde438fc9b10af3a435b06bb0b Reviewed-by: Paul Olav Tvete --- src/quick/scenegraph/qsgwindowsrenderloop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick/scenegraph/qsgwindowsrenderloop.cpp') diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 10eba74607..070d6b82fd 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -286,7 +286,7 @@ QImage QSGWindowsRenderLoop::grab(QQuickWindow *window) d->syncSceneGraph(); d->renderSceneGraph(window->size()); - QImage image = qt_gl_read_framebuffer(window->size() * window->devicePixelRatio(), false, false); + QImage image = qt_gl_read_framebuffer(window->size() * window->effectiveDevicePixelRatio(), false, false); return image; } -- cgit v1.2.3