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 <andy.nichols@theqtcompany.com>
This commit is contained in:
Laszlo Agocs 2015-08-17 18:04:34 +02:00
parent 1fe890317a
commit 95aad72e84

View 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>
@ -62,6 +63,10 @@
#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);