Blame SOURCES/0007-gtk-channel-cursor-copy-spicec-hack-RHBZ-998529.patch

4b3e03
From c4428fd886ca344fb77a684028e181236873b05e Mon Sep 17 00:00:00 2001
4b3e03
From: Alon Levy <alevy@redhat.com>
4b3e03
Date: Wed, 28 Aug 2013 16:14:16 +0300
4b3e03
Subject: [PATCH 2/2] gtk/channel-cursor: copy spicec hack, RHBZ #998529
4b3e03
4b3e03
flip -> unsupported by x11, since XCreatePixmapCursor has no invert
4b3e03
functionality, only a mask, shape, background and foreground colors. Use
4b3e03
this checkerboard hack to get some contrast for cursors in the guest
4b3e03
that relied on invert for the same contrast.
4b3e03
---
4b3e03
 gtk/channel-cursor.c | 23 ++++++++++++++++++-----
4b3e03
 1 file changed, 18 insertions(+), 5 deletions(-)
4b3e03
4b3e03
diff --git a/gtk/channel-cursor.c b/gtk/channel-cursor.c
4b3e03
index 41ad696..e4a996b 100644
4b3e03
--- a/gtk/channel-cursor.c
4b3e03
+++ b/gtk/channel-cursor.c
4b3e03
@@ -259,11 +259,24 @@ static void mono_cursor(display_cursor *cursor, const guint8 *data)
4b3e03
         for (x = 0; x < cursor->hdr.width; x++, dest += 4) {
4b3e03
             if (and[x/8] & bit) {
4b3e03
                 if (xor[x/8] & bit) {
4b3e03
-                    /* flip -> hmm? */
4b3e03
-                    dest[0] = 0x00;
4b3e03
-                    dest[1] = 0x00;
4b3e03
-                    dest[2] = 0x00;
4b3e03
-                    dest[3] = 0x80;
4b3e03
+                    /*
4b3e03
+                     * flip -> unsupported by x11, since XCreatePixmapCursor has
4b3e03
+                     * no invert functionality, only a mask, shape, background and
4b3e03
+                     * foreground colors. Use this checkerboard hack to get some
4b3e03
+                     * contrast for cursors in the guest that relied on invert for
4b3e03
+                     * the same contrast.
4b3e03
+                     */
4b3e03
+                    if ((x ^ y) & 1) {
4b3e03
+                        dest[0] = 0x30;
4b3e03
+                        dest[1] = 0x30;
4b3e03
+                        dest[2] = 0x30;
4b3e03
+                        dest[3] = 0xc0;
4b3e03
+                    } else {
4b3e03
+                        dest[0] = 0x50;
4b3e03
+                        dest[1] = 0x50;
4b3e03
+                        dest[2] = 0x50;
4b3e03
+                        dest[3] = 0x30;
4b3e03
+                    }
4b3e03
                 } else {
4b3e03
                     /* unchanged -> transparent */
4b3e03
                     dest[0] = 0x00;
4b3e03
-- 
4b3e03
1.8.3.1
4b3e03