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

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

Change-Id: I8532c923bacd605434cfca1c7e314cb95d41b372
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp

index ccf86dafb2b4c73757e254ca9aa6378573897ede..8c8c8a15ea64ccb750c8485fabe42cca210ca974 100644 (file)
 #include <QtGui/private/qguiapplication_p.h>
 #include <qpa/qplatforminputcontextfactory_p.h>
 
+#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>
@@ -130,6 +134,13 @@ QPlatformServices *QLinuxFbIntegration::services() const
 
 void QLinuxFbIntegration::createInputHandlers()
 {
+#ifndef QT_NO_LIBINPUT
+    if (!qEnvironmentVariableIntValue("QT_QPA_FB_NO_LIBINPUT")) {
+        new QLibInputHandler(QLatin1String("libinput"), QString());
+        return;
+    }
+#endif
+
 #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
     new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this);
     new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this);