]> Dogcows Code - chaz/openbox/blobdiff - render/color.c
grow to edge is a move and a resize, oops
[chaz/openbox] / render / color.c
index d16bbf0cdd93b8e06cc2eee2664f2f6ea2fe5edf..f791b9c48582a16d2fe5581c9d9e9a5603824603 100644 (file)
@@ -59,6 +59,8 @@ RrColor *RrColorNew(const RrInstance *inst, gint r, gint g, gint b)
 void RrColorFree(RrColor *c)
 {
     if (c) {
+        if (c->pixel) XFreeColors(RrDisplay(c->inst), RrColormap(c->inst),
+                                  &c->pixel, 1, 0);
         if (c->gc) XFreeGC(RrDisplay(c->inst), c->gc);
         g_free(c);
     }
@@ -257,3 +259,11 @@ gulong RrColorPixel(const RrColor *c)
 {
     return c->pixel;
 }
+
+GC RrColorGC(RrColor *c) /* XXX make this const RrColor* when the GCs are in
+                            a cache.. if possible? */
+{
+    if (!c->gc)
+        RrColorAllocateGC(c);
+    return c->gc;
+}
This page took 0.025092 seconds and 4 git commands to generate.