Bug#841853: inkscape: Mouse cursor is a white outline on PowerPC

Steven Gawroriski steven at multiphasicapps.net
Sat Nov 5 23:06:04 UTC 2016


Taking a look at this myself. The issue is related to cursors and is
either an issue in:

 * Inkscape
 * GDK
 * XRender

Since the star cursor in Inkscape shows the color to be drawn,
including alpha. Using the color `FFDD8833` (which is kind of a tan
color) appears on the star cursor itself as a sky blue. The actual
color being shown on the cursor is `#3388DD` (or ARGB #FF3388DD).
Changing in Inkscape the `FF` (which should be red, but is alpha) makes
the blue in the cursor a bit transparent.

I am definitely certain that the issue is in Inkscape only. Other
programs such as GIMP and anything else do not have any cursor issues
at all from what I can tell. If GDK or XRender were at fault, likely
more than just a single program would be broken.

The only place in the Inkscape code which loads cursors is
`sp_cursor_pixbuf_from_xpm`. The `RGBA` struct has a static cast to a
`guint32` which bitshifts in values accordingly. However part of the
function `sp_cursor_pixbuf_from_xpm` contains the following:

    guint32 *pixmap_buffer = new guint32[width * height];

However, before returning this buffer is `reinterpret_cast`ed such as
the following:

    return
    gdk_pixbuf_new_from_data(reinterpret_cast<guchar*>(pixmap_buffer),
    GDK_COLORSPACE_RGB, TRUE, 8, width, height, width *
    sizeof(guint32), free_cursor_data, NULL);

Looking at the documentation for `gdk_pixbuf_new_from_data`, the data
for this call is just specified as _Image data in 8-bit/sample packed
format_.

I wrote the attached patch which essentially byte swaps the value
before this function returns. The cursors are drawn correctly and
Inkscape can now be used much more easily. If a contributor agreement
is required then I would accept giving away my copyright for the code
contained in this patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: byte-swap-in-sp_cursor_pixbuf_from_xpm-for-be.patch
Type: text/x-patch
Size: 1032 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20161105/08bf64f2/attachment.bin>


More information about the pkg-multimedia-maintainers mailing list