]> Pileus Git - ~andy/gtk/commitdiff
Ensure that GtkIconView items get redrawn when the focus cell changes.
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 5 Jan 2011 16:30:17 +0000 (01:30 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Thu, 6 Jan 2011 04:51:49 +0000 (13:51 +0900)
Seems the redraw was not happenning from keynav when set_focus_cell()
was called because keynav already updates the focus-cell. Now we
just unconditionally redraw the focus item when set_focus_cell() is
called.

gtk/gtkiconview.c

index de5889ec78d86ccad549bfb65e83adce513c16f8..47dc4c751a3736ae2c2ac5c258153739b274611f 100644 (file)
@@ -3083,6 +3083,13 @@ gtk_icon_view_set_cursor_item (GtkIconView     *icon_view,
   AtkObject *item_obj;
   AtkObject *cursor_item_obj;
 
+  /* When hitting this path from keynav, the focus cell is
+   * already set, we dont need to notify the atk object
+   * but we still need to queue the draw here (in the case
+   * that the focus cell changes but not the cursor item).
+   */
+  gtk_icon_view_queue_draw_item (icon_view, item);
+
   if (icon_view->priv->cursor_item == item &&
       (cursor_cell == NULL || cursor_cell == gtk_cell_area_get_focus_cell (icon_view->priv->cell_area)))
     return;
@@ -3108,8 +3115,6 @@ gtk_icon_view_set_cursor_item (GtkIconView     *icon_view,
       if (!gtk_cell_area_get_focus_cell (icon_view->priv->cell_area))
        gtk_cell_area_focus (icon_view->priv->cell_area, GTK_DIR_TAB_FORWARD);
     }
-
-  gtk_icon_view_queue_draw_item (icon_view, item);
   
   /* Notify that accessible focus object has changed */
   item_obj = atk_object_ref_accessible_child (obj, item->index);