After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735847 - move animatable cursors' current frame info into GdkCursor
move animatable cursors' current frame info into GdkCursor
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-09-01 21:04 UTC by Carlos Garnacho
Modified: 2015-11-24 19:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Do not store the grab cursor separately (3.14 KB, patch)
2015-11-24 19:44 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-09-01 21:04:59 UTC
Currently GdkWaylandDeviceData maintains both the current GdkCursor in use and the current image index to be used during cursor animations, IMO it would be great to move this within the GdkWaylandCursor so it is easier to maintain multiple cursors (as right now is being done for grab/window-under-pointer cursors), and have all of those easily animatable without per-cursor frame counters.

gdkdevice-wayland.c still looks anyway like a proper place to maintain the animation itself, as it has knowledge of which cursor applies currently, so I would suggest to have a gdk_wayland_cursor_tick() kind of API, that bumps the image, and a gdk_wayland_cursor_reset_animation() to reset no longer used cursors to the initial frame.
Comment 1 Matthias Clasen 2014-09-04 03:01:35 UTC
Maybe. Seeing a patch might convince me this is a great idea. Maybe just resetting the image_index to 0 whenever the cursor changes is good enough.
Comment 2 Matthias Clasen 2015-08-27 01:27:53 UTC
Is this something we still want ?
Comment 3 Carlos Garnacho 2015-11-24 19:44:50 UTC
Created attachment 316199 [details] [review]
wayland: Do not store the grab cursor separately

After the grab is finished, we would expect an enter event, and
GDK updating internally the cursor for that window and device.
This means there is no need at all to store it separately in the
backend.

As a side effect, animated cursors are now also possible on grab
icons.
Comment 4 Carlos Garnacho 2015-11-24 19:45:59 UTC
I had this patch in the wip/wayland-tablet branch. This is far nicer in comparison, will push this one.
Comment 5 Matthias Clasen 2015-11-24 19:47:25 UTC
Review of attachment 316199 [details] [review]:

nice
Comment 6 Carlos Garnacho 2015-11-24 19:56:19 UTC
Attachment 316199 [details] pushed as 5f59d7d - wayland: Do not store the grab cursor separately