diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index dba37cea7dfd0b909034b1f21458bca7e24b8c5c..3d72373675f3e17194ee22fcb444caba4ac63b13 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -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()