Commit 7c5f2a93 authored by Alexandru Croitor's avatar Alexandru Croitor
Browse files

Fix incorrect device pixel ratio used on startup.


Report the correct device pixel ratio to Chromium, when the
QOpenGLWidget gets initialized. The initial value on startup is
incorrect, because Chromium tries to query the screen information,
before a relevant QWindow handle can be returned, and thus defaults to
1.0f.

Change-Id: Ibbedd7b2915840f9716340e582aedbc13406f11a
Task-number: QTBUG-49727
Reviewed-by: default avatarMichael Brüning <michael.bruning@theqtcompany.com>
Showing with 6 additions and 0 deletions
......@@ -271,6 +271,12 @@ void RenderWidgetHostViewQtDelegateWidget::initializeGL()
m_sgRenderer.reset(m_sgEngine->createRenderer());
m_sgRenderer->setRootNode(m_rootNode.data());
m_sgRenderer->setClearColor(Qt::white);
// When RenderWidgetHostViewQt::GetScreenInfo is called for the first time, the associated
// QWindow is NULL, and the screen device pixel ratio can not be queried.
// Re-initialize the screen information after the QWindow handle is available,
// so Chromium receives the correct device pixel ratio.
m_client->windowChanged();
}
void RenderWidgetHostViewQtDelegateWidget::paintGL()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment