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/evdevkeyboard/qevdevkeyboardmanager.cpp | |
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/evdevkeyboard/qevdevkeyboardmanager.cpp')
-rw-r--r-- | src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp index 4614fbd499..8853da8371 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp @@ -37,6 +37,9 @@ #include <QCoreApplication> #include <QLoggingCategory> +#include <private/qguiapplication_p.h> +#include <private/qinputdevicemanager_p_p.h> + QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(qLcEvdevKey) @@ -97,10 +100,13 @@ void QEvdevKeyboardManager::addKeyboard(const QString &deviceNode) qCDebug(qLcEvdevKey) << "Adding keyboard at" << deviceNode; QEvdevKeyboardHandler *keyboard; keyboard = QEvdevKeyboardHandler::create(deviceNode, m_spec, m_defaultKeymapFile); - if (keyboard) + if (keyboard) { m_keyboards.insert(deviceNode, keyboard); - else + QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( + QInputDeviceManager::DeviceTypeKeyboard, m_keyboards.count()); + } else { qWarning("Failed to open keyboard device %s", qPrintable(deviceNode)); + } } void QEvdevKeyboardManager::removeKeyboard(const QString &deviceNode) @@ -109,6 +115,8 @@ void QEvdevKeyboardManager::removeKeyboard(const QString &deviceNode) qCDebug(qLcEvdevKey) << "Removing keyboard at" << deviceNode; QEvdevKeyboardHandler *keyboard = m_keyboards.value(deviceNode); m_keyboards.remove(deviceNode); + QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount( + QInputDeviceManager::DeviceTypeKeyboard, m_keyboards.count()); delete keyboard; } } |