From 863dfb1541f4f0865a6e4ee42dbef159eaa7f2d0 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Date: Tue, 15 Sep 2015 17:06:39 +0200
Subject: [PATCH] eglfs: Create input handlers only when screens are available

Some code may rely on the primary screen geometry for example.

Task-number: QTBUG-47002
Change-Id: I42fc1ccf0c1d91beb5d8e9691ac6ec4e7400e567
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
---
 src/plugins/platforms/eglfs/qeglfsintegration.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 5f2cc9abbc2..f0946b9b647 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -129,13 +129,14 @@ void QEglFSIntegration::initialize()
 
     m_vtHandler.reset(new QFbVtHandler);
 
-    if (!m_disableInputHandlers)
-        createInputHandlers();
-
     if (qt_egl_device_integration()->usesDefaultScreen())
         addScreen(new QEglFSScreen(display()));
     else
         qt_egl_device_integration()->screenInit();
+
+    // Input code may rely on the screens, so do it only after the screen init.
+    if (!m_disableInputHandlers)
+        createInputHandlers();
 }
 
 void QEglFSIntegration::destroy()
-- 
GitLab