Index: gtk/gtkiconview.c
===================================================================
--- gtk/gtkiconview.c	(Revision 20756)
+++ gtk/gtkiconview.c	(Arbeitskopie)
@@ -149,6 +149,7 @@ struct _GtkIconViewPrivate
   gint row_spacing;
   gint column_spacing;
   gint margin;
+  gint item_padding;
 
   gint text_column;
   gint markup_column;
@@ -716,6 +717,21 @@ gtk_icon_view_class_init (GtkIconViewCla
 						     0, G_MAXINT, 6,
 						     GTK_PARAM_READWRITE));
 
+  /**
+   * GtkIconView:item-padding:
+   *
+   * The item-padding property specifies the padding around each
+   * of the icon view's item.
+   *
+   * Since: 2.16
+   */
+  g_object_class_install_property (gobject_class,
+                                   PROP_COLUMN_SPACING,
+                                   g_param_spec_int ("item-padding",
+						     P_("Item Padding"),
+						     P_("Padding around icon view items"),
+						     0, G_MAXINT, 6,
+						     GTK_PARAM_READWRITE));
 
   /**
    * GtkIconView:orientation:
@@ -988,6 +1004,7 @@ gtk_icon_view_init (GtkIconView *icon_vi
   icon_view->priv->row_spacing = 6;
   icon_view->priv->column_spacing = 6;
   icon_view->priv->margin = 6;
+  icon_view->priv->item_padding = 6;
 }
 
 static void
@@ -1303,8 +1320,8 @@ gtk_icon_view_allocate_children (GtkIcon
       /* totally ignore our child's requisition */
       if (child->cell < 0)
 	{
-	  allocation.x = child->item->x;
-	  allocation.y = child->item->y;
+	  allocation.x = child->item->x + icon_view->priv->item_padding;
+	  allocation.y = child->item->y + icon_view->priv->item_padding;
 	  allocation.width = child->item->width;
 	  allocation.height = child->item->height;
 	}
@@ -1312,8 +1329,8 @@ gtk_icon_view_allocate_children (GtkIcon
 	{
 	  GdkRectangle *box = &child->item->box[child->cell];
 
-	  allocation.x = box->x;
-	  allocation.y = box->y;
+	  allocation.x = box->x + icon_view->priv->item_padding;
+	  allocation.y = box->y + icon_view->priv->item_padding;
 	  allocation.width = box->width;
 	  allocation.height = box->height;
 	}
@@ -1778,10 +1795,6 @@ gtk_icon_view_start_editing (GtkIconView
 						  0);
       g_free (path_string);      
 
-      /* FIXME ugly special case */ 
-      if (GTK_IS_ENTRY (editable) || GTK_IS_COMBO_BOX (editable))
-	g_object_set (editable, "has-frame", TRUE, NULL);
-
       /* the rest corresponds to tree_view_real_start_editing... */
       icon_view->priv->edited_item = item;
       icon_view->priv->editable = editable;
@@ -1973,7 +1986,7 @@ gtk_icon_view_button_press (GtkWidget   
   GtkIconViewCellInfo *info = NULL;
   gboolean dirty = FALSE;
   GtkCellRendererMode mode;
-  gint cursor_cell;
+  gint cursor_cell = -1;
 
   icon_view = GTK_ICON_VIEW (widget);
 
@@ -1988,17 +2001,18 @@ gtk_icon_view_button_press (GtkWidget   
       item = gtk_icon_view_get_item_at_coords (icon_view, 
 					       event->x, event->y,
 					       TRUE,
-					       &info);      
+					       &info); 
       if (item != NULL)
 	{
-	  g_object_get (info->cell, "mode", &mode, NULL);
-	  
-	  if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE ||
-	      mode == GTK_CELL_RENDERER_MODE_EDITABLE)
-	    cursor_cell = g_list_index (icon_view->priv->cell_list, info);
-	  else
-	    cursor_cell = -1;
-	  
+          if (info != NULL)
+            {
+	      g_object_get (info->cell, "mode", &mode, NULL);
+ 
+	      if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE ||
+	          mode == GTK_CELL_RENDERER_MODE_EDITABLE)
+	        cursor_cell = g_list_index (icon_view->priv->cell_list, info);
+	    }
+
 	  gtk_icon_view_scroll_to_item (icon_view, item);
 	  
 	  if (icon_view->priv->selection_mode == GTK_SELECTION_NONE)
@@ -2057,13 +2071,16 @@ gtk_icon_view_button_press (GtkWidget   
 
 	  /* cancel the current editing, if it exists */
 	  gtk_icon_view_stop_editing (icon_view, TRUE);
-	  
-	  if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
-	    gtk_icon_view_item_activate_cell (icon_view, item, info, 
-					      (GdkEvent *)event);
-	  else if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
-	    gtk_icon_view_start_editing (icon_view, item, info, 
-					 (GdkEvent *)event);	  
+
+          if (info != NULL)
+            {
+	      if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
+	        gtk_icon_view_item_activate_cell (icon_view, item, info, 
+	          			          (GdkEvent *)event);
+	      else if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
+	        gtk_icon_view_start_editing (icon_view, item, info, 
+	      				     (GdkEvent *)event);	  
+            }
 	}
       else
 	{
@@ -2738,6 +2755,7 @@ gtk_icon_view_get_cell_area (GtkIconView
       cell_area->width = item->box[info->position].width + 
 	item->before[info->position] + item->after[info->position];
       cell_area->height = item->height;
+      cell_area->height -= icon_view->priv->item_padding * 2;
     }
   else
     {
@@ -2746,7 +2764,11 @@ gtk_icon_view_get_cell_area (GtkIconView
       cell_area->width = item->width;
       cell_area->height = item->box[info->position].height + 
 	item->before[info->position] + item->after[info->position];
+      cell_area->width -= icon_view->priv->item_padding * 2;
     }
+
+  cell_area->x += icon_view->priv->item_padding;
+  cell_area->y += icon_view->priv->item_padding; 
 }
 
 static void 
@@ -2758,6 +2780,8 @@ gtk_icon_view_get_cell_box (GtkIconView 
   g_return_if_fail (info->position < item->n_cells);
 
   *box = item->box[info->position];
+  box->x += icon_view->priv->item_padding;
+  box->y += icon_view->priv->item_padding;
 }
 
 /* try to guess a reasonable wrap width for an implicit text cell renderer
@@ -2804,6 +2828,8 @@ adjust_wrap_width (GtkIconView     *icon
       else
 	wrap_width = item_width - pixbuf_width - icon_view->priv->spacing;
 
+      wrap_width -= icon_view->priv->item_padding * 2;
+
       g_object_set (text_info->cell, "wrap-width", wrap_width, NULL);
       g_object_set (text_info->cell, "width", wrap_width, NULL);
     }
@@ -2862,6 +2888,9 @@ gtk_icon_view_calculate_item_size (GtkIc
 	  item->height += item->box[info->position].height + (info->position > 0 ? spacing : 0);
 	}
     }
+
+  item->width += icon_view->priv->item_padding * 2;
+  item->height += icon_view->priv->item_padding * 2;
 }
 
 static void
@@ -2948,7 +2977,12 @@ gtk_icon_view_calculate_item_size2 (GtkI
 	  item->box[i].x = item->x + item->width - 
 	    (item->box[i].x + item->box[i].width - item->x);
 	}      
-    }	
+    }
+
+  /* NOTE: increasing item->width by the item padding here
+     causes the layouting code to crash, but doesn't seem
+     to be needed anyway */  
+  item->height += icon_view->priv->item_padding * 2;
 }
 
 static void
@@ -3017,28 +3051,17 @@ gtk_icon_view_paint_item (GtkIconView   
 #endif
 
   if (item->selected)
-    for (l = icon_view->priv->cell_list; l; l = l->next)
-      {
-	GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
-	
-	if (!info->cell->visible)
-	  continue;
-	
-	gtk_icon_view_get_cell_box (icon_view, item, info, &box);
-
-	/* FIXME we hardwire background drawing behind text
-	 * cell renderers here 
-	 */
-	if (GTK_IS_CELL_RENDERER_TEXT (info->cell))
-	  {
-	    gdk_cairo_set_source_color (cr, &GTK_WIDGET (icon_view)->style->base[state]);
-	    cairo_rectangle (cr,
-			     x - item->x + box.x, 
-			     y - item->y + box.y,
-			     box.width, box.height);
-	    cairo_fill (cr);
-	  }
-      }
+    {
+      gtk_paint_flat_box (GTK_WIDGET (icon_view)->style,
+			  (GdkWindow *) drawable,
+			  GTK_STATE_SELECTED,
+			  GTK_SHADOW_NONE,
+			  area,
+			  GTK_WIDGET (icon_view),
+			  "icon_view_item",
+			  x, y,
+			  item->width, item->height);
+    }
   
   for (l = icon_view->priv->cell_list; l; l = l->next)
     {
@@ -3074,42 +3097,56 @@ gtk_icon_view_paint_item (GtkIconView   
 				drawable,
 				GTK_WIDGET (icon_view),
 				&cell_area, &cell_area, area, flags);
-      
     }
 
-  /* FIXME where to draw the focus with generic cell renderers ? */
   if (draw_focus && 
       GTK_WIDGET_HAS_FOCUS (icon_view) &&
       item == icon_view->priv->cursor_item)
-    for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
-      {
-	GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
-	
-	if (!info->cell->visible)
-	  continue;
-	
-	if (icon_view->priv->cursor_cell < 0 &&
-	    (info->cell->mode != GTK_CELL_RENDERER_MODE_INERT ||
-	     GTK_IS_CELL_RENDERER_TEXT (info->cell)))
-	  icon_view->priv->cursor_cell = i;
-	
-	if (i == icon_view->priv->cursor_cell)
-	  {
-	    gtk_icon_view_get_cell_box (icon_view, item, info, &box);
+    {
+      for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
+        {
+          GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
+          
+          if (!info->cell->visible)
+            continue;
 
-	    gtk_paint_focus (GTK_WIDGET (icon_view)->style,
-			     drawable,
-			     GTK_STATE_NORMAL,
-			     area,
-			     GTK_WIDGET (icon_view),
-			     "icon_view",
-			     x - item->x + box.x - padding,
-			     y - item->y + box.y - padding,
-			     box.width + 2 * padding,
-			     box.height + 2 * padding);
-	    break;
-	  }
-      }
+          /* If found a editable/activatable cell, draw focus on it. */          
+          if (icon_view->priv->cursor_cell < 0 &&
+              info->cell->mode != GTK_CELL_RENDERER_MODE_INERT)
+            icon_view->priv->cursor_cell = i;
+
+          gtk_icon_view_get_cell_box (icon_view, item, info, &box);
+          
+          if (i == icon_view->priv->cursor_cell)
+            {
+              gtk_paint_focus (GTK_WIDGET (icon_view)->style,
+          		     drawable,
+          		     GTK_STATE_NORMAL,
+          		     area,
+          		     GTK_WIDGET (icon_view),
+          		     "icon_view",
+                             x - item->x + box.x - padding,
+                             y - item->y + box.y - padding,
+                             box.width + 2 * padding,
+                             box.height + 2 * padding);
+              break;
+            }
+        }
+
+      /* If there are no editable/activatable cells, draw focus 
+       * around the whole item. */          
+      if (icon_view->priv->cursor_cell < 0)
+        gtk_paint_focus (GTK_WIDGET (icon_view)->style,
+            	   drawable,
+            	   GTK_STATE_NORMAL,
+            	   area,
+            	   GTK_WIDGET (icon_view),
+            	   "icon_view",
+                   x - padding,
+                   y - padding,
+                   item->width + 2 * padding,
+                   item->height + 2 * padding);
+    }
 }
 
 static void
@@ -3339,7 +3376,7 @@ gtk_icon_view_get_item_at_coords (GtkIco
 		    }
 		}
 
-	      if (only_in_cell)
+	      if (only_in_cell && !item->selected)
 		return NULL;
 	      
 	      if (cell_at_pos)
@@ -5359,13 +5396,11 @@ update_pixbuf_cell (GtkIconView *icon_vi
 
 	if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
 	  g_object_set (info->cell,
-			"follow-state", TRUE, 
 			"xalign", 0.5,
 			"yalign", 1.0,
 			NULL);
 	else
 	  g_object_set (info->cell,
-			"follow-state", TRUE, 
 			"xalign", 0.0,
 			"yalign", 0.0,
 			NULL);
@@ -6099,6 +6134,51 @@ gtk_icon_view_get_margin (GtkIconView *i
   return icon_view->priv->margin;
 }
 
+/**
+ * gtk_icon_view_set_item_padding:
+ * @icon_view: a #GtkIconView
+ * @column_spacing: the item padding
+ * 
+ * Sets the ::item-padding property which specifies the padding 
+ * around each of the icon view's items.
+ *
+ * Since: 2.16
+ */
+void 
+gtk_icon_view_set_item_padding (GtkIconView *icon_view,
+				gint         item_padding)
+{
+  g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
+  
+  if (icon_view->priv->item_padding != item_padding)
+    {
+      icon_view->priv->item_padding = item_padding;
+
+      gtk_icon_view_stop_editing (icon_view, TRUE);
+      gtk_icon_view_invalidate_sizes (icon_view);
+      gtk_icon_view_queue_layout (icon_view);
+      
+      g_object_notify (G_OBJECT (icon_view), "item-padding");
+    }  
+}
+
+/**
+ * gtk_icon_view_get_item_padding:
+ * @icon_view: a #GtkIconView
+ * 
+ * Returns the value of the ::item-padding property.
+ * 
+ * Return value: the padding around items
+ *
+ * Since: 2.16
+ */
+gint
+gtk_icon_view_get_item_padding (GtkIconView *icon_view)
+{
+  g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
+
+  return icon_view->priv->item_padding;
+}
 
 /* Get/set whether drag_motion requested the drag data and
  * drag_data_received should thus not actually insert the data,
Index: gtk/gtk.symbols
===================================================================
--- gtk/gtk.symbols	(Revision 20756)
+++ gtk/gtk.symbols	(Arbeitskopie)
@@ -1845,6 +1845,8 @@ gtk_icon_view_set_tooltip_cell
 gtk_icon_view_get_tooltip_context
 gtk_icon_view_set_tooltip_column
 gtk_icon_view_get_tooltip_column
+gtk_icon_view_set_item_padding
+gtk_icon_view_get_item_padding
 #endif
 #endif
 
Index: gtk/gtkiconview.h
===================================================================
--- gtk/gtkiconview.h	(Revision 20756)
+++ gtk/gtkiconview.h	(Arbeitskopie)
@@ -125,6 +125,9 @@ gint           gtk_icon_view_get_column_
 void           gtk_icon_view_set_margin        (GtkIconView    *icon_view, 
 					        gint            margin);
 gint           gtk_icon_view_get_margin        (GtkIconView    *icon_view);
+void           gtk_icon_view_set_item_padding  (GtkIconView    *icon_view, 
+					        gint            item_padding);
+gint           gtk_icon_view_get_item_padding  (GtkIconView    *icon_view);
 
 
 GtkTreePath *  gtk_icon_view_get_path_at_pos   (GtkIconView     *icon_view,
