summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2010-12-20 20:07:00 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2010-12-20 20:12:43 +0100
commitef2d7d1524ffcc3db8e9f0b9182393995c940d59 (patch)
treef6d64fa10589a2a7def36ac2e9cedf1f86ce9368
parent4d7eb220e43f126b4aa05f2354687543a0c38048 (diff)
gtk: fix cursor r/b colors being inverted
-rw-r--r--gtk/channel-cursor.c10
1 files changed, 10 insertions, 0 deletions
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;