]> Pileus Git - ~andy/gtk/commitdiff
Added special clause to GtkCellAreaBox focus navigation.
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 1 Dec 2010 06:18:40 +0000 (15:18 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 1 Dec 2010 06:18:40 +0000 (15:18 +0900)
If the area has no activatable cells and has focus when
focus should be cycled, immediately focus out of the area
(because focus in that case is given to the entire area).

gtk/gtkcellareabox.c

index 0ded281858747ca90712510880fab3d92a64e620..12988e6ad26a9d45884fa5bd2d548678071ee24c 100644 (file)
@@ -1826,6 +1826,16 @@ gtk_cell_area_box_focus (GtkCellArea      *area,
 
   focus_cell = gtk_cell_area_get_focus_cell (area);
 
+  /* Special case, when there is no activatable cell, focus
+   * is painted around the entire area... in this case we
+   * let focus leave the area directly.
+   */
+  if (focus_cell && !gtk_cell_area_is_activatable (area))
+    {
+      gtk_cell_area_set_focus_cell (area, NULL);
+      return FALSE;
+    }
+
   switch (direction)
     {
     case GTK_DIR_TAB_FORWARD: