From d96b765b61661e88ece6229baa09cde04fe9ba61 Mon Sep 17 00:00:00 2001
From: Christophe Chapuis <chris.chapuis@gmail.com>
Date: Sat, 31 Oct 2015 16:04:01 +0100
Subject: [PATCH 11/18] GetScreenInfo: use default screen when no window is
 available

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
---
 src/core/render_widget_host_view_qt.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 958ff91..5105214 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -711,9 +711,12 @@ void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32_t output_surface_id, c
 void RenderWidgetHostViewQt::GetScreenInfo(content::ScreenInfo* results)
 {
     QWindow* window = m_delegate->window();
-    if (!window)
-        return;
-    GetScreenInfoFromNativeWindow(window, results);
+    if( window ) {
+        GetScreenInfoFromNativeWindow(window, results);
+    }
+    else {
+        GetDefaultScreenInfo(results);
+    }
 
     // Support experimental.viewport.devicePixelRatio
     results->device_scale_factor *= dpiScale();
-- 
2.7.4

