diff options
| author | Richard M. Stallman | 1995-07-19 15:47:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-07-19 15:47:28 +0000 |
| commit | 828e66d1a5d6e6a50d6fa207e29b2a6374bb81c8 (patch) | |
| tree | 53a1770afc41c8527a6514159e23fe6b9db93e6a /src | |
| parent | 6da74aab1545260205ba43e912e6a05ad33b4b95 (diff) | |
| download | emacs-828e66d1a5d6e6a50d6fa207e29b2a6374bb81c8.tar.gz emacs-828e66d1a5d6e6a50d6fa207e29b2a6374bb81c8.zip | |
(unload_color): Don't free colors if immutable colormap.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 8872b724810..59e09d95077 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -363,14 +363,22 @@ unload_color (f, pixel) | |||
| 363 | { | 363 | { |
| 364 | Colormap cmap; | 364 | Colormap cmap; |
| 365 | Display *dpy = FRAME_X_DISPLAY (f); | 365 | Display *dpy = FRAME_X_DISPLAY (f); |
| 366 | int class = FRAME_X_DISPLAY_INFO (f)->visual->class; | ||
| 367 | |||
| 366 | if (pixel == FACE_DEFAULT | 368 | if (pixel == FACE_DEFAULT |
| 367 | || pixel == BLACK_PIX_DEFAULT (f) | 369 | || pixel == BLACK_PIX_DEFAULT (f) |
| 368 | || pixel == WHITE_PIX_DEFAULT (f)) | 370 | || pixel == WHITE_PIX_DEFAULT (f)) |
| 369 | return; | 371 | return; |
| 370 | cmap = DefaultColormapOfScreen (DefaultScreenOfDisplay (dpy)); | 372 | cmap = DefaultColormapOfScreen (DefaultScreenOfDisplay (dpy)); |
| 371 | BLOCK_INPUT; | 373 | |
| 372 | XFreeColors (dpy, cmap, &pixel, 1, (unsigned long)0); | 374 | /* If display has an immutable color map, freeing colors is not |
| 373 | UNBLOCK_INPUT; | 375 | necessary and some servers don't allow it. So don't do it. */ |
| 376 | if (! (class == StaticColor || class == StaticGray || class == TrueColor)) | ||
| 377 | { | ||
| 378 | BLOCK_INPUT; | ||
| 379 | XFreeColors (dpy, cmap, &pixel, 1, (unsigned long)0); | ||
| 380 | UNBLOCK_INPUT; | ||
| 381 | } | ||
| 374 | } | 382 | } |
| 375 | 383 | ||
| 376 | DEFUN ("pixmap-spec-p", Fpixmap_spec_p, Spixmap_spec_p, 1, 1, 0, | 384 | DEFUN ("pixmap-spec-p", Fpixmap_spec_p, Spixmap_spec_p, 1, 1, 0, |