diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-01-27 13:40:42 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-31 12:07:59 +0100 |
commit | 6953f3a501dfee5064a12558a2e2515b69b35189 (patch) | |
tree | 4d99834383d6a00f49fe3ef99c11b373aedac394 /src/platformsupport/eglconvenience/qeglplatformcursor_p.h | |
parent | 231cac611920d7735975b82fda1efee9a12a77f2 (diff) |
eglfs: Mouse hotplugging support
On Embedded Linux with libudev support hotplugging was already working,
except that the mouse cursor was not shown and hidden. This is now
corrected so that the cursor disappears when all mice become disconnected
and reappears if a mouse gets plugged in later on.
[ChangeLog][QtGui] Mouse hotplugging is now fully supported in eglfs
when running on Embedded Linux systems with libudev support enabled.
Task-number: QTBUG-36374
Change-Id: Iec7c1557ba6085e3958dd357460cc032896fb174
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcursor_p.h')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformcursor_p.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h index 52359b84cd..d1402d1457 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h @@ -48,6 +48,25 @@ QT_BEGIN_NAMESPACE class QOpenGLShaderProgram; +class QDeviceDiscovery; +class QEGLPlatformCursor; + +class QEGLPlatformCursorDeviceListener : public QObject +{ + Q_OBJECT + +public: + QEGLPlatformCursorDeviceListener(QDeviceDiscovery *dd, QEGLPlatformCursor *cursor); + bool hasMouse() const; + +private slots: + void onDeviceAdded(); + void onDeviceRemoved(); + +private: + QEGLPlatformCursor *m_cursor; + int m_mouseCount; +}; class QEGLPlatformCursor : public QPlatformCursor { @@ -66,6 +85,9 @@ public: void paintOnScreen(); void resetResources(); + void setMouseDeviceDiscovery(QDeviceDiscovery *dd); + void updateMouseStatus(); + private: #ifndef QT_NO_CURSOR bool setCurrentCursor(QCursor *cursor); @@ -107,6 +129,7 @@ private: int m_vertexCoordEntry; int m_textureCoordEntry; int m_textureEntry; + QEGLPlatformCursorDeviceListener *m_deviceListener; }; QT_END_NAMESPACE |