X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gdk%2Fx11%2Fgdkcolor-x11.c;h=5cc43e136a7881f257d0435e33a51f1a7ad02ec9;hb=fac76f942636905932240a4327cd8d76c6360017;hp=7282d6a329e687915c1e23a0e84149b3af1aaa7d;hpb=bb0446a014d1481cb4ffff92646e29833a443a4e;p=~andy%2Fgtk diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c index 7282d6a32..5cc43e136 100644 --- a/gdk/x11/gdkcolor-x11.c +++ b/gdk/x11/gdkcolor-x11.c @@ -658,7 +658,7 @@ gdk_colors_free (GdkColormap *colormap, } } - if (npixels_to_free && !private->screen->closed) + if (npixels_to_free && !private->private_val && !private->screen->closed) XFreeColors (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap, pixels_to_free, npixels_to_free, planes); g_free (pixels_to_free); @@ -715,7 +715,7 @@ gdk_colormap_free_colors (GdkColormap *colormap, } } - if (npixels && !private->screen->closed) + if (npixels_to_free && !private->private_val && !private->screen->closed) XFreeColors (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap, pixels, npixels, 0); @@ -811,7 +811,7 @@ gdk_colormap_alloc_colors_writeable (GdkColormap *colormap, else break; } - return i; + return ncolors - i; } else { @@ -832,7 +832,7 @@ gdk_colormap_alloc_colors_writeable (GdkColormap *colormap, g_free (pixels); - return status ? ncolors : 0; + return status ? 0 : ncolors; } } @@ -851,7 +851,6 @@ gdk_colormap_alloc_colors_private (GdkColormap *colormap, gint nremaining = 0; private = GDK_COLORMAP_PRIVATE_DATA (colormap); - index = -1; /* First, store the colors we have room for */ @@ -913,7 +912,7 @@ gdk_colormap_alloc_colors_private (GdkColormap *colormap, g_free (available); } - return (ncolors - nremaining); + return nremaining; } static gint @@ -930,7 +929,6 @@ gdk_colormap_alloc_colors_shared (GdkColormap *colormap, gint nfailed = 0; private = GDK_COLORMAP_PRIVATE_DATA (colormap); - index = -1; for (i=0; i