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 696223 - wayland: loading cursors from pixbuf does not work
wayland: loading cursors from pixbuf does not work
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: wayland
 
 
Reported: 2013-03-20 20:16 UTC by Thomas Andersen
Modified: 2013-03-22 05:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Complete _gdk_wayland_display_get_cursor_for_pixbuf (7.05 KB, patch)
2013-03-20 20:19 UTC, Thomas Andersen
needs-work Details | Review
updated patch for comments (7.79 KB, patch)
2013-03-21 20:22 UTC, Thomas Andersen
none Details | Review

Description Thomas Andersen 2013-03-20 20:16:17 UTC
When testing with e.g. gnome-robots that loads it own custom cursors the cursor simply becomes invisible.
Comment 1 Thomas Andersen 2013-03-20 20:19:00 UTC
Created attachment 239408 [details] [review]
Complete _gdk_wayland_display_get_cursor_for_pixbuf
Comment 2 Thomas Andersen 2013-03-20 20:21:36 UTC
Works well for gnome-robots. The cursor hotspots seems to be a bit off but I suspect that it could be related to bug #695512
Comment 3 Thomas Andersen 2013-03-20 20:39:11 UTC
Also works for aisleriot.
Comment 4 Kristian Høgsberg 2013-03-21 01:51:21 UTC
Review of attachment 239408 [details] [review]:

Tested the patch and it work fine here.  Should be good to commit with the comments below addressed.

::: gdk/wayland/gdkcursor-wayland.c
@@ +215,3 @@
 					cursor->height,
+                    stride,
+                    WL_SHM_FORMAT_ARGB8888);

Funky indentation here...

We can and should destroy the pool object right after creating the wl_buffer from it.  Also, wl_buffers from the cursor theme are owned by the theme and doesn't need to be freed.  In case of a cursor created from a pixbuf (type == GDK_CURSOR_IS_PIXMAP), we own the wl_buffer and need to destroy it (wl_buffer_destroy) in finalize.

Also, I'd fold create_cursor into _gdk_wayland_display_get_cursor_for_pixbuf at this point.
Comment 5 Thomas Andersen 2013-03-21 20:22:26 UTC
Created attachment 239497 [details] [review]
updated patch for comments
Comment 6 Kristian Høgsberg 2013-03-21 22:01:37 UTC
Thanks, pushed as:

commit c5145421af3e641b3070bba2a83d3c2f74a06f53
Author: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date:   Thu Mar 21 21:05:32 2013 +0100

    wayland: complete cursor_for_pixbuf
    
    Finishes the implementation for loading cursors from pixbufs.
    
    Gnome bug #696223