From ef2d7d1524ffcc3db8e9f0b9182393995c940d59 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Mon, 20 Dec 2010 20:07:00 +0100 Subject: gtk: fix cursor r/b colors being inverted --- gtk/channel-cursor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gtk/channel-cursor.c b/gtk/channel-cursor.c index ea369a8..8cc05a6 100644 --- a/gtk/channel-cursor.c +++ b/gtk/channel-cursor.c @@ -306,6 +306,8 @@ static display_cursor *set_cursor(SpiceChannel *channel, SpiceCursor *scursor) size_t size; gint i, pix_mask, pix; const guint8* data; + guint8 *rgba; + guint8 val; SPICE_DEBUG("%s: type %d, %" PRIx64 ", %dx%d, flags %d, size %d", __FUNCTION__, hdr->type, hdr->unique, hdr->width, hdr->height, @@ -379,6 +381,14 @@ static display_cursor *set_cursor(SpiceChannel *channel, SpiceCursor *scursor) break; } + rgba = (guint8*)cursor->data; + for (i = 0; i < hdr->width * hdr->height; i++) { + val = rgba[0]; + rgba[0] = rgba[2]; + rgba[2] = val; + rgba += 4; + } + if (cursor && (scursor->flags & SPICE_CURSOR_FLAGS_CACHE_ME)) { item = cache_add(&c->cursors, hdr->unique); item->ptr = cursor; -- cgit v1.2.3