comparison src/xterm.c @ 27962:048184bb751e

(x_alloc_lighter_color, x_setup_relief_color): Use x_free_colors.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 02 Mar 2000 13:26:21 +0000
parents df344d4f5f10
children 7d61ff2d1530
comparison
equal deleted inserted replaced
27961:c6664d216f5a 27962:048184bb751e
3259 { 3259 {
3260 if (new.pixel == *pixel) 3260 if (new.pixel == *pixel)
3261 { 3261 {
3262 /* If we end up with the same color as before, try adding 3262 /* If we end up with the same color as before, try adding
3263 delta to the RGB values. */ 3263 delta to the RGB values. */
3264 int class = FRAME_X_DISPLAY_INFO (f)->visual->class; 3264 x_free_colors (f, &new.pixel, 1);
3265
3266 /* If display has an immutable color map, freeing colors is
3267 not necessary and some servers don't allow it. So don't
3268 do it. */
3269 if (class != StaticColor
3270 && class != StaticGray
3271 && class != TrueColor)
3272 XFreeColors (display, cmap, &new.pixel, 1, 0);
3273 3265
3274 new.red = min (0xffff, delta + color.red); 3266 new.red = min (0xffff, delta + color.red);
3275 new.green = min (0xffff, delta + color.green); 3267 new.green = min (0xffff, delta + color.green);
3276 new.blue = min (0xffff, delta + color.blue); 3268 new.blue = min (0xffff, delta + color.blue);
3277 success_p = x_alloc_nearest_color (f, cmap, &new); 3269 success_p = x_alloc_nearest_color (f, cmap, &new);
3318 if (relief->gc 3310 if (relief->gc
3319 && relief->allocated_p) 3311 && relief->allocated_p)
3320 { 3312 {
3321 /* If display has an immutable color map, freeing colors is not 3313 /* If display has an immutable color map, freeing colors is not
3322 necessary and some servers don't allow it. So don't do it. */ 3314 necessary and some servers don't allow it. So don't do it. */
3323 int class = dpyinfo->visual->class; 3315 x_free_colors (f, &relief->pixel, 1);
3324 if (class != StaticColor
3325 && class != StaticGray
3326 && class != TrueColor)
3327 XFreeColors (dpy, cmap, &relief->pixel, 1, 0);
3328 relief->allocated_p = 0; 3316 relief->allocated_p = 0;
3329 } 3317 }
3330 3318
3331 /* Allocate new color. */ 3319 /* Allocate new color. */
3332 xgcv.foreground = default_pixel; 3320 xgcv.foreground = default_pixel;