Skip to content

Commit

Permalink
Added QInputDeviceManager device tracking for bsdkeyboard and bsdmouse
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
gonzoua committed Jul 14, 2016
1 parent a013bec commit 39da348
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/generic/bsdkeyboard/qbsdkeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/generic/bsdmouse/qbsdmouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 39da348

Please sign in to comment.