From 95aad72e841b7d9bdef97a934c7fdfd65dc7122c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 17 Aug 2015 18:04:34 +0200 Subject: [PATCH] eglfs: Use libinput by default when available 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 --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index aec5a5e179..5f2cc9abbc 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -62,6 +63,10 @@ #include +#ifndef QT_NO_LIBINPUT +#include +#endif + #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) #include #include @@ -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);