Added QInputDeviceManager device tracking for bsdkeyboard and bsdmouse
After initialization bsdkeyboard and bsdmouse didn't notify QInputDeviceManager about new input devices so parts of Qt that relied on these notifications (like QFbCursor) were not aware about new functionality. Set number of keyboard/pointer devices to 1 when bsdkeyboard and bsdmouse plugins successfully initialized Change-Id: I440826d2b7f3653fd43e58df8239346ba1e8a223 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
parent
a013bec13e
commit
39da34853f
@ -44,6 +44,8 @@
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
#include <private/qcore_unix_p.h>
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <private/qinputdevicemanager_p_p.h>
|
||||
|
||||
#include <qdebug.h>
|
||||
#include <cstdio>
|
||||
@ -145,6 +147,8 @@ QBsdKeyboardHandler::QBsdKeyboardHandler(const QString &key, const QString &spec
|
||||
|
||||
m_notifier.reset(new QSocketNotifier(m_fd, QSocketNotifier::Read, this));
|
||||
connect(m_notifier.data(), &QSocketNotifier::activated, this, &QBsdKeyboardHandler::readKeyboardData);
|
||||
QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
|
||||
QInputDeviceManager::DeviceTypeKeyboard, 1);
|
||||
}
|
||||
|
||||
QBsdKeyboardHandler::~QBsdKeyboardHandler()
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include <QPoint>
|
||||
#include <QGuiApplication>
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <private/qinputdevicemanager_p_p.h>
|
||||
|
||||
#include <private/qcore_unix_p.h>
|
||||
#include <qdebug.h>
|
||||
@ -105,6 +107,8 @@ QBsdMouseHandler::QBsdMouseHandler(const QString &key, const QString &specificat
|
||||
|
||||
m_notifier.reset(new QSocketNotifier(m_devFd, QSocketNotifier::Read, this));
|
||||
connect(m_notifier.data(), &QSocketNotifier::activated, this, &QBsdMouseHandler::readMouseData);
|
||||
QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
|
||||
QInputDeviceManager::DeviceTypePointer, 1);
|
||||
}
|
||||
|
||||
QBsdMouseHandler::~QBsdMouseHandler()
|
||||
|
Loading…
Reference in New Issue
Block a user