# HG changeset patch # User Karl Heuer # Date 933016196 0 # Node ID 9f5d679349e990864252c1fecae635be58d71ea2 # Parent 2eca330f89d792f0d6c2f51e855419b850b9a75f (x_set_mouse_color): Always unload the old color. Don't allow nil as color value. (x_set_cursor_color, x_set_background_color, x_set_foreground_color): Always unload the old color. diff -r 2eca330f89d7 -r 9f5d679349e9 src/xfns.c --- a/src/xfns.c Mon Jul 26 19:06:37 1999 +0000 +++ b/src/xfns.c Mon Jul 26 19:09:56 1999 +0000 @@ -1314,10 +1314,7 @@ unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); - if (f->output_data.x->foreground_pixel != f->output_data.x->mouse_pixel - && f->output_data.x->foreground_pixel != f->output_data.x->cursor_pixel - && f->output_data.x->foreground_pixel != f->output_data.x->cursor_foreground_pixel) - unload_color (f, f->output_data.x->foreground_pixel); + unload_color (f, f->output_data.x->foreground_pixel); f->output_data.x->foreground_pixel = pixel; if (FRAME_X_WINDOW (f) != 0) @@ -1345,10 +1342,7 @@ unsigned long pixel = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); - if (f->output_data.x->background_pixel != f->output_data.x->mouse_pixel - && f->output_data.x->background_pixel != f->output_data.x->cursor_pixel - && f->output_data.x->background_pixel != f->output_data.x->cursor_foreground_pixel) - unload_color (f, f->output_data.x->background_pixel); + unload_color (f, f->output_data.x->background_pixel); f->output_data.x->background_pixel = pixel; if (FRAME_X_WINDOW (f) != 0) @@ -1388,23 +1382,15 @@ Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; Cursor busy_cursor; int count; - int mask_color; - unsigned long pixel = f->output_data.x->mouse_pixel; - - if (!EQ (Qnil, arg)) - pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); - - mask_color = f->output_data.x->background_pixel; - /* No invisible pointers. */ + unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); + unsigned long mask_color = f->output_data.x->background_pixel; + + /* Don't let pointers be invisible. */ if (mask_color == pixel && mask_color == f->output_data.x->background_pixel) pixel = f->output_data.x->foreground_pixel; - if (f->output_data.x->background_pixel != f->output_data.x->mouse_pixel - && f->output_data.x->foreground_pixel != f->output_data.x->mouse_pixel - && f->output_data.x->cursor_pixel != f->output_data.x->mouse_pixel - && f->output_data.x->cursor_foreground_pixel != f->output_data.x->mouse_pixel) - unload_color (f, f->output_data.x->mouse_pixel); + unload_color (f, f->output_data.x->mouse_pixel); f->output_data.x->mouse_pixel = pixel; BLOCK_INPUT; @@ -1544,18 +1530,10 @@ fore_pixel = f->output_data.x->background_pixel; } - if (f->output_data.x->background_pixel != f->output_data.x->cursor_foreground_pixel - && f->output_data.x->foreground_pixel != f->output_data.x->cursor_foreground_pixel - && f->output_data.x->mouse_pixel != f->output_data.x->cursor_foreground_pixel - && f->output_data.x->cursor_pixel != f->output_data.x->cursor_foreground_pixel) - unload_color (f, f->output_data.x->cursor_foreground_pixel); + unload_color (f, f->output_data.x->cursor_foreground_pixel); f->output_data.x->cursor_foreground_pixel = fore_pixel; - if (f->output_data.x->background_pixel != f->output_data.x->cursor_pixel - && f->output_data.x->foreground_pixel != f->output_data.x->cursor_pixel - && f->output_data.x->mouse_pixel != f->output_data.x->cursor_pixel - && f->output_data.x->cursor_foreground_pixel != f->output_data.x->cursor_pixel) - unload_color (f, f->output_data.x->cursor_pixel); + unload_color (f, f->output_data.x->cursor_pixel); f->output_data.x->cursor_pixel = pixel; if (FRAME_X_WINDOW (f) != 0)