From 10472dce9202e4460b2d908bdbe0cd65291f77e5 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 9 Jan 2015 14:48:01 +0100 Subject: Unify input device hotplugging support for embedded On embedded the mouse cursor will now appear and reappear regardless of how the input handling code is loaded (via a generic plugin or compiled-in to the platform plugin). Instead of passing around QDeviceDiscovery instances that only works when compiling-in the code into the platform plugin, introduce a new internal central QInputDeviceManager. The single instance of this provides a place to store any future input device related signals and properties. Also introduce mouse hotplugging support to linuxfb. [ChangeLog][QtGui] The mouse cursor on Embedded Linux is now handling hotplugging correctly with eglfs and linuxfb regardless of how the input handling code is loaded (via a generic plugin or built in to the platform plugin). Change-Id: I147c1b04a193baf216598015264f2c06e1b20f84 Reviewed-by: Andy Nichols --- .../platforms/linuxfb/qlinuxfbintegration.cpp | 7 +------ src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 21 +-------------------- 2 files changed, 2 insertions(+), 26 deletions(-) (limited to 'src/plugins/platforms/linuxfb') diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp index 1600ee3f2b..6785464cea 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp @@ -130,12 +130,7 @@ void QLinuxFbIntegration::createInputHandlers() { #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this); - QEvdevMouseManager *mouseMgr = new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this); - Q_FOREACH (QScreen *screen, QGuiApplication::screens()) { - QFbCursor *cursor = qobject_cast(screen->handle()->cursor()); - if (cursor) - cursor->setMouseDeviceDiscovery(mouseMgr->deviceDiscovery()); - } + new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this); #ifndef QT_NO_TSLIB const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB"); if (useTslib) diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index a66c9fa252..592ce90b16 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -55,10 +55,6 @@ #include -#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) -#include -#endif - QT_BEGIN_NAMESPACE static int openFramebufferDevice(const QString &dev) @@ -393,22 +389,7 @@ bool QLinuxFbScreen::initialize() QFbScreen::initializeCompositor(); mFbScreenImage = QImage(mMmap.data, geometry.width(), geometry.height(), mBytesPerLine, mFormat); - QByteArray hideCursorVal = qgetenv("QT_QPA_FB_HIDECURSOR"); -#if !defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK) - bool hideCursor = false; -#else - bool hideCursor = true; // default to true to prevent the cursor showing up with the subclass on Android -#endif - if (hideCursorVal.isEmpty()) { -#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) - QScopedPointer dis(QDeviceDiscovery::create(QDeviceDiscovery::Device_Mouse)); - hideCursor = dis->scanConnectedDevices().isEmpty(); -#endif - } else { - hideCursor = hideCursorVal.toInt() != 0; - } - if (!hideCursor) - mCursor = new QFbCursor(this); + mCursor = new QFbCursor(this); mTtyFd = openTtyDevice(ttyDevice); if (mTtyFd == -1) -- cgit v1.2.3