From e8d31d1b315c40ef0906579b429bc04279a1686d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sun, 29 Dec 2013 19:53:24 +0100 Subject: [PATCH] linuxfb: Make mouse cursor behavior match eglfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On non-Android systems hideCursor should default to false, just like it is done in eglfs. This is especially useful on udev-less systems where currently one has to resort to setting QT_QPA_FB_HIDECURSOR to "0" to enable the mouse cursor. This is not ideal. Defaulting to showing the cursor unless disabled by the environment variable or, in absence of that, the lack of a mouse reported by udev is a better choice. Change-Id: I7362ac47046179d5eb8ed8b44cf2c36c0fc23432 Reviewed-by: Jørgen Lind --- src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index 4f9284da7f..735a43daf7 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -400,7 +400,11 @@ bool QLinuxFbScreen::initialize() mFbScreenImage = QImage(mMmap.data, geometry.width(), geometry.height(), mBytesPerLine, mFormat); QByteArray hideCursorVal = qgetenv("QT_QPA_FB_HIDECURSOR"); +#if !defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK) + bool hideCursor = false; +#else bool hideCursor = true; // default to true to prevent the cursor showing up with the subclass on Android +#endif if (hideCursorVal.isEmpty()) { #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) QScopedPointer dis(QDeviceDiscovery::create(QDeviceDiscovery::Device_Mouse));