diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-02-06 09:32:22 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-05-02 11:07:43 +0000 |
commit | 20314e67f66f9bee74438a00cde17922bd2da18a (patch) | |
tree | 4832852b2ff5c0d008a9273a33672a661bb7aae3 /src/client/qwaylandcursor.cpp | |
parent | 3eea45e31ef796ab6f1363f8fd2882c151becc20 (diff) |
Client: Add support for animated cursors
[ChangeLog][QPA plugin] Added support for animated cursors.
Previously we would just show the first frame of the animation.
Fixes: QTBUG-48181
Change-Id: Ie06bff8950678b5ff7b7e2e50915c85905a1200b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandcursor.cpp')
-rw-r--r-- | src/client/qwaylandcursor.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp index 8b2ed036d..165df7762 100644 --- a/src/client/qwaylandcursor.cpp +++ b/src/client/qwaylandcursor.cpp @@ -209,7 +209,7 @@ wl_cursor *QWaylandCursorTheme::requestCursor(WaylandCursor shape) return nullptr; } -struct wl_cursor_image *QWaylandCursorTheme::cursorImage(Qt::CursorShape shape) +::wl_cursor_image *QWaylandCursorTheme::cursorImage(Qt::CursorShape shape, uint millisecondsIntoAnimation) { struct wl_cursor *waylandCursor = nullptr; @@ -227,8 +227,9 @@ struct wl_cursor_image *QWaylandCursorTheme::cursorImage(Qt::CursorShape shape) return nullptr; } - struct wl_cursor_image *image = waylandCursor->images[0]; - struct wl_buffer *buffer = wl_cursor_image_get_buffer(image); + int frame = wl_cursor_frame(waylandCursor, millisecondsIntoAnimation); + ::wl_cursor_image *image = waylandCursor->images[frame]; + ::wl_buffer *buffer = wl_cursor_image_get_buffer(image); if (!buffer) { qCWarning(lcQpaWayland) << "Could not find buffer for cursor"; return nullptr; |