eglfs: Use libinput by default when available
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Mon, 17 Aug 2015 16:04:34 +0000 (18:04 +0200)
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Tue, 18 Aug 2015 08:07:27 +0000 (08:07 +0000)
Can be overridden by setting QT_QPA_EGLFS_NO_LIBINPUT.

On systems where libinput is present it is usually a better choice
to rely on it instead of evdev*.

Change-Id: I78857ff91c837f58fdc7d1e119260bd6819fbf4e
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
src/plugins/platforms/eglfs/qeglfsintegration.cpp

index aec5a5e179b08d4199f7123acca1f7a2b495dac8..5f2cc9abbc2b545411fb669f209e9ab2b7b1342f 100644 (file)
@@ -40,6 +40,7 @@
 #include <QtGui/QScreen>
 #include <QtGui/QOffscreenSurface>
 #include <QtGui/QWindow>
+#include <QtCore/QLoggingCategory>
 #include <qpa/qwindowsysteminterface.h>
 #include <qpa/qplatforminputcontextfactory_p.h>
 
 
 #include <QtPlatformHeaders/QEGLNativeContext>
 
+#ifndef QT_NO_LIBINPUT
+#include <QtPlatformSupport/private/qlibinputhandler_p.h>
+#endif
+
 #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
 #include <QtPlatformSupport/private/qevdevmousemanager_p.h>
 #include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
@@ -389,6 +394,13 @@ void QEglFSIntegration::loadKeymapStatic(const QString &filename)
 
 void QEglFSIntegration::createInputHandlers()
 {
+#ifndef QT_NO_LIBINPUT
+    if (!qEnvironmentVariableIntValue("QT_QPA_EGLFS_NO_LIBINPUT")) {
+        new QLibInputHandler(QLatin1String("libinput"), QString());
+        return;
+    }
+#endif
+
 #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
     m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
     new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);