From: Karl Heuer Date: Mon, 26 Jul 1999 19:09:56 +0000 (+0000) Subject: (x_set_mouse_color): Always unload the old color. X-Git-Tag: emacs-pretest-21.0.90~7366 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=51a1d2d86b16dac04df52e9f82f7aba48f687cf2;p=emacs.git (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 --git a/src/xfns.c b/src/xfns.c index 251b48dd322..385724fcf84 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1314,10 +1314,7 @@ x_set_foreground_color (f, arg, oldval) 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 @@ x_set_background_color (f, arg, oldval) 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 @@ x_set_mouse_color (f, arg, oldval) 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)); + unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); + unsigned long mask_color = f->output_data.x->background_pixel; - mask_color = f->output_data.x->background_pixel; - /* No invisible pointers. */ + /* 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 @@ x_set_cursor_color (f, arg, oldval) 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)