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>
This commit is contained in:
parent
6131b90953
commit
2a1b50d67c
@ -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
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
|
||||
|
||||
private:
|
||||
QAbstractEventDispatcher *mEventDispatcher;
|
||||
QPlatformFontDatabase *mFontDb;
|
||||
QPlatformScreen *mScreen;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user