diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2013-10-11 14:42:14 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-14 12:08:12 +0200 |
commit | 4ba1072f3f9dff2c674e804eeb998d88510db89c (patch) | |
tree | 350556224340459f41fe4808dbc076c070581548 /src/plugins/platforms/linuxfb | |
parent | a662d42125c5e65166d4f1597a407ec6c351e5d8 (diff) |
linuxfb: Make the mouse cursor visible and working
Change-Id: I58bae7235ae714da551da1337ee6340fc712aaa5
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/linuxfb')
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index 0d5bba8457..6a2d767723 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -62,6 +62,10 @@ #include <linux/fb.h> +#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) +#include <QtPlatformSupport/private/qdevicediscovery_p.h> +#endif + QT_BEGIN_NAMESPACE static int openFramebufferDevice(const QString &dev) @@ -394,7 +398,19 @@ bool QLinuxFbScreen::initialize(const QStringList &args) QFbScreen::initializeCompositor(); mFbScreenImage = QImage(mMmap.data, geometry.width(), geometry.height(), mBytesPerLine, mFormat); - mCursor = new QFbCursor(this); + + QByteArray hideCursorVal = qgetenv("QT_QPA_FB_HIDECURSOR"); + bool hideCursor = true; // default to true to prevent the cursor showing up with the subclass on Android + if (hideCursorVal.isEmpty()) { +#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) + QScopedPointer<QDeviceDiscovery> dis(QDeviceDiscovery::create(QDeviceDiscovery::Device_Mouse)); + hideCursor = dis->scanConnectedDevices().isEmpty(); +#endif + } else { + hideCursor = hideCursorVal.toInt() != 0; + } + if (!hideCursor) + mCursor = new QFbCursor(this); mTtyFd = openTtyDevice(ttyDevice); if (mTtyFd == -1) |