From 2a1b50d67c1f2f4c5bd5efe048080989db37f44f Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 30 May 2012 22:28:53 -0700 Subject: eglfs: Create mouse, keyboard and touch handlers by default Prior to this change, input support for eglfs was loaded as plugins. With this change, eglfs supports evdev based keyboard, mouse and touch input out of the box. The event dispatcher is created in the constructor because the evdev code creates QSocketNotifiers in the constructor which requires an event loop. Change-Id: I4e08f4121b9381ee5b414d0886eae2b8a2925800 Reviewed-by: Johannes Zellner Reviewed-by: Romain Pokrzywka Reviewed-by: Donald Carr Reviewed-by: Girish Ramakrishnan Reviewed-by: Laszlo Agocs --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 16 ++++++++++++++-- src/plugins/platforms/eglfs/qeglfsintegration.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index b485eba050..a42f685a38 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -45,10 +45,16 @@ #include "qeglfsbackingstore.h" #include "qeglfshooks.h" +#include + #include #include #include +#include +#include +#include + #include #include #include @@ -60,8 +66,14 @@ QT_BEGIN_NAMESPACE QEglFSIntegration::QEglFSIntegration() - : mFontDb(new QGenericUnixFontDatabase()), mScreen(new QEglFSScreen) + : mEventDispatcher(createUnixEventDispatcher()), mFontDb(new QGenericUnixFontDatabase()), mScreen(new QEglFSScreen) { + QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher); + + new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this); + new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this); + new QEvdevTouchScreenHandlerThread(QString() /* spec */, this); + screenAdded(mScreen); #ifdef QEGL_EXTRA_DEBUG @@ -120,7 +132,7 @@ QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const QAbstractEventDispatcher *QEglFSIntegration::guiThreadEventDispatcher() const { - return createUnixEventDispatcher(); + return mEventDispatcher; } QVariant QEglFSIntegration::styleHint(QPlatformIntegration::StyleHint hint) const diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 04d77a5903..14cec21d13 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -76,6 +76,7 @@ public: void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); private: + QAbstractEventDispatcher *mEventDispatcher; QPlatformFontDatabase *mFontDb; QPlatformScreen *mScreen; }; -- cgit v1.2.3