diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-01-27 13:40:42 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-31 12:07:59 +0100 |
commit | 6953f3a501dfee5064a12558a2e2515b69b35189 (patch) | |
tree | 4d99834383d6a00f49fe3ef99c11b373aedac394 /src/platformsupport/eglconvenience/qeglplatformintegration.cpp | |
parent | 231cac611920d7735975b82fda1efee9a12a77f2 (diff) |
eglfs: Mouse hotplugging support
On Embedded Linux with libudev support hotplugging was already working,
except that the mouse cursor was not shown and hidden. This is now
corrected so that the cursor disappears when all mice become disconnected
and reappears if a mouse gets plugged in later on.
[ChangeLog][QtGui] Mouse hotplugging is now fully supported in eglfs
when running on Embedded Linux systems with libudev support enabled.
Task-number: QTBUG-36374
Change-Id: Iec7c1557ba6085e3958dd357460cc032896fb174
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformintegration.cpp')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformintegration.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp index 343375a14a..5fc1721f6c 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp @@ -41,6 +41,7 @@ #include <QtGui/QWindow> #include <QtGui/QOpenGLContext> +#include <QtGui/QGuiApplication> #include <qpa/qwindowsysteminterface.h> #include <qpa/qplatforminputcontextfactory_p.h> @@ -49,11 +50,18 @@ #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> #include <QtPlatformSupport/private/qfbvthandler_p.h> +#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> +#include <QtPlatformSupport/private/qevdevtouch_p.h> +#endif + #include "qeglplatformintegration_p.h" #include "qeglplatformcontext_p.h" #include "qeglplatformwindow_p.h" #include "qeglplatformbackingstore_p.h" #include "qeglplatformscreen_p.h" +#include "qeglplatformcursor_p.h" QT_BEGIN_NAMESPACE @@ -256,4 +264,18 @@ QPlatformNativeInterface::NativeResourceForContextFunction QEGLPlatformIntegrati return 0; } +void QEGLPlatformIntegration::createInputHandlers() +{ +#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) + new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this); + QEvdevMouseManager *mouseMgr = new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this); + Q_FOREACH (QScreen *screen, QGuiApplication::screens()) { + QEGLPlatformCursor *cursor = static_cast<QEGLPlatformCursor *>(screen->handle()->cursor()); + if (cursor) + cursor->setMouseDeviceDiscovery(mouseMgr->deviceDiscovery()); + } + new QEvdevTouchScreenHandlerThread(QString() /* spec */, this); +#endif +} + QT_END_NAMESPACE |