Index: app/tools/gimpcolortool.c
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimpcolortool.c,v
retrieving revision 1.28
diff -u -p -u -p -r1.28 gimpcolortool.c
--- app/tools/gimpcolortool.c	28 May 2006 14:13:44 -0000	1.28
+++ app/tools/gimpcolortool.c	1 Jun 2006 02:56:56 -0000
@@ -616,8 +616,18 @@ gimp_color_tool_real_picked (GimpColorTo
 {
   GimpTool    *tool = GIMP_TOOL (color_tool);
   GimpContext *user_context;
+/* added! */
+  GimpDialogFactory *dialog_factory;
+  GimpPaletteEditor *palette_editor = NULL;
+  GimpSessionInfo   *info;
+  gint               index;
 
   user_context = gimp_get_user_context (tool->display->image->gimp);
+  dialog_factory = gimp_dialog_factory_from_name ("dock");
+  info = gimp_dialog_factory_find_session_info (dialog_factory,
+                                                "gimp-palette-editor");
+  if (info && info->widget)
+    palette_editor = GIMP_PALETTE_EDITOR (gtk_bin_get_child (GTK_BIN (info->widget)));
 
   if ((color_tool->pick_mode == GIMP_COLOR_PICK_MODE_FOREGROUND ||
        color_tool->pick_mode == GIMP_COLOR_PICK_MODE_BACKGROUND) &&
@@ -649,6 +659,9 @@ gimp_color_tool_real_picked (GimpColorTo
 
     case GIMP_COLOR_PICK_MODE_FOREGROUND:
       gimp_context_set_foreground (user_context, color);
+      index = gimp_palette_editor_get_index (palette_editor, color);
+      if (index != -1)
+        gimp_palette_editor_set_index (palette_editor, index, NULL);
       break;
 
     case GIMP_COLOR_PICK_MODE_BACKGROUND:
