diff options
author | Martin Gräßlin <mgraesslin@kde.org> | 2016-03-02 11:04:10 +0100 |
---|---|---|
committer | Martin Gräßlin <mgraesslin@kde.org> | 2016-03-17 06:40:40 +0000 |
commit | 9cbd553eeb758bb060514f17d4615003da16429a (patch) | |
tree | c5dfb0fbf3f510881155150532bb51c7c1bf49e5 /src/client/qwaylandinputdevice_p.h | |
parent | 759822f33f56acb3e2bacf19c6431ea4fa2be229 (diff) |
Add support for bitmap cursors
So far QtWayland did not support custom bitmap/pixmap QCursors.
This change adds support for them by creating a QWaylandShmBuffer and
copying the pixmap data into that buffer. The internal API to set
cursors images is changed to not only rely on wl_cursor_image, but also
allow to just set the buffer with a specific size and a hot spot.
The created WaylandShmBuffer is passed around as a shared pointer, so
that it can be automatically cleaned up once the cursor image is no
longer used on any seat.
Task-number: QTBUG-51604
Change-Id: I1f1ee87f03186c3d564468d3e8ea2a3141d7e2fb
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
Diffstat (limited to 'src/client/qwaylandinputdevice_p.h')
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index 8bfb45cd4..508b67078 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -93,7 +93,10 @@ public: struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); } void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); + void setCursor(const QCursor &cursor, QWaylandScreen *screen); void setCursor(struct wl_buffer *buffer, struct ::wl_cursor_image *image); + void setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size); + void setCursor(const QSharedPointer<QWaylandBuffer> &buffer, const QPoint &hotSpot); void handleWindowDestroyed(QWaylandWindow *window); void setDataDevice(QWaylandDataDevice *device); @@ -137,6 +140,8 @@ private: QTouchDevice *mTouchDevice; + QSharedPointer<QWaylandBuffer> mPixmapCursor; + friend class QWaylandTouchExtension; friend class QWaylandQtKeyExtension; }; |