diff options
author | Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> | 2012-05-30 22:28:53 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-02 10:25:31 +0200 |
commit | 2a1b50d67c1f2f4c5bd5efe048080989db37f44f (patch) | |
tree | f3a542107ef83101f1a3fde3cdcd6a0801090ad2 /src/plugins/platforms | |
parent | 6131b909532f7bfdcbc8fa2f35f2c6f84c06547d (diff) |
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 <johannes.zellner@nokia.com>
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@kdab.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 16 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.h | 1 |
2 files changed, 15 insertions, 2 deletions
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 <QtGui/private/qguiapplication_p.h> + #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h> #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> #include <QtPlatformSupport/private/qeglplatformcontext_p.h> +#include <QtPlatformSupport/private/qevdevmousemanager_p.h> +#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h> +#include <QtPlatformSupport/private/qevdevtouch_p.h> + #include <qpa/qplatformwindow.h> #include <QtGui/QSurfaceFormat> #include <QtGui/QOpenGLContext> @@ -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; }; |