changeset 25075:9f5d679349e9

(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.
author Karl Heuer <kwzh@gnu.org>
date Mon, 26 Jul 1999 19:09:56 +0000
parents 2eca330f89d7
children e87adc0eb94f
files src/xfns.c
diffstat 1 files changed, 9 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- 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)