[Spice-devel] [PATCH 2/2] gtk/channel-cursor: copy spicec hack, RHBZ #998529

Alon Levy alevy at redhat.com
Wed Aug 28 06:16:09 PDT 2013


---
 gtk/channel-cursor.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/gtk/channel-cursor.c b/gtk/channel-cursor.c
index 41ad696..3068385 100644
--- a/gtk/channel-cursor.c
+++ b/gtk/channel-cursor.c
@@ -259,11 +259,18 @@ static void mono_cursor(display_cursor *cursor, const guint8 *data)
         for (x = 0; x < cursor->hdr.width; x++, dest += 4) {
             if (and[x/8] & bit) {
                 if (xor[x/8] & bit) {
-                    /* flip -> hmm? */
-                    dest[0] = 0x00;
-                    dest[1] = 0x00;
-                    dest[2] = 0x00;
-                    dest[3] = 0x80;
+                    /* flip -> unsupported by cairo, use this checkerboard hack */
+                    if ((x ^ y) & 1) {
+                        dest[0] = 0x30;
+                        dest[1] = 0x30;
+                        dest[2] = 0x30;
+                        dest[3] = 0xc0;
+                    } else {
+                        dest[0] = 0x50;
+                        dest[1] = 0x50;
+                        dest[2] = 0x50;
+                        dest[3] = 0x30;
+                    }
                 } else {
                     /* unchanged -> transparent */
                     dest[0] = 0x00;
-- 
1.8.3.1



More information about the Spice-devel mailing list