diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-01-09 14:48:01 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-01-21 12:32:04 +0100 |
commit | 10472dce9202e4460b2d908bdbe0cd65291f77e5 (patch) | |
tree | 4a0d970fcedb4e7b0b01c3f65cd9c7886473dfe0 /src/platformsupport/input/evdevmouse | |
parent | f93c04e44a5bd08fea76a1147b1aa51953bce925 (diff) |
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 <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/input/evdevmouse')
-rw-r--r-- | src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp | 7 | ||||
-rw-r--r-- | src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp index a0c9c9f34d..17e6b0cafa 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp @@ -38,6 +38,9 @@ #include <QScreen> #include <QLoggingCategory> #include <qpa/qwindowsysteminterface.h> +#include <QtPlatformSupport/private/qdevicediscovery_p.h> +#include <private/qguiapplication_p.h> +#include <private/qinputdevicemanager_p_p.h> QT_BEGIN_NAMESPACE @@ -141,6 +144,8 @@ void QEvdevMouseManager::addMouse(const QString &deviceNode) connect(handler, SIGNAL(handleMouseEvent(int,int,bool,Qt::MouseButtons)), this, SLOT(handleMouseEvent(int,int,bool,Qt::MouseButtons))); connect(handler, SIGNAL(handleWheelEvent(int,Qt::Orientation)), this, SLOT(handleWheelEvent(int,Qt::Orientation))); m_mice.insert(deviceNode, handler); + QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( + QInputDeviceManager::DeviceTypePointer, m_mice.count()); } else { qWarning("evdevmouse: Failed to open mouse device %s", qPrintable(deviceNode)); } @@ -152,6 +157,8 @@ void QEvdevMouseManager::removeMouse(const QString &deviceNode) qCDebug(qLcEvdevMouse) << "Removing mouse at" << deviceNode; QEvdevMouseHandler *handler = m_mice.value(deviceNode); m_mice.remove(deviceNode); + QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( + QInputDeviceManager::DeviceTypePointer, m_mice.count()); delete handler; } } diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h index 14aa6a8fd2..d30a2b337f 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h +++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h @@ -47,14 +47,14 @@ #include "qevdevmousehandler_p.h" -#include <QtPlatformSupport/private/qdevicediscovery_p.h> - #include <QObject> #include <QHash> #include <QSocketNotifier> QT_BEGIN_NAMESPACE +class QDeviceDiscovery; + class QEvdevMouseManager : public QObject { Q_OBJECT @@ -62,8 +62,6 @@ public: QEvdevMouseManager(const QString &key, const QString &specification, QObject *parent = 0); ~QEvdevMouseManager(); - QDeviceDiscovery *deviceDiscovery() { return m_deviceDiscovery; } - public slots: void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons); void handleWheelEvent(int delta, Qt::Orientation orientation); |