-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: b999908e4b61858b25af8341646ec5b4258bb30f:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit b999908e4b61858b25af8341646ec5b4258bb30f
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Fri Jan 13 12:40:53 2012 +0000

    Set the color pixel to a fallback value also when XftColorAllocValue
    fails in rxvt_color::alloc.

diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C

index a1a28464f0b61fe91612e406aa2922e583204388..

index ..a924a64273cd618dbfd07e5c2c4ade92de023f9e 100644

--- a/src/rxvttoolkit.C
+++ b/src/rxvttoolkit.C
@@ -727,7 +727,8 @@ rxvt_color::alloc (rxvt_screen *screen, const rgba &color)
       d.blue  = color.b;
       d.alpha = alpha;

-      return XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c);
+      if (XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c))
+        return true;
     }
 #else
   c.red   = color.r;
@@ -744,12 +745,12 @@ rxvt_color::alloc (rxvt_screen *screen, const rgba &color)
     }
   else if (XAllocColor (screen->dpy, screen->cmap, &c))
     return true;
-  else
-    c.pixel = (color.r + color.g + color.b) > 128*3
-            ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->dpy))
-            : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->dpy));
 #endif

+  c.pixel = (color.r + color.g + color.b) > 128*3
+          ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->dpy))
+          : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->dpy));
+
   return false;
 }

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 09:41:10 2024