]> Pileus Git - ~andy/gtk/commitdiff
Handle clicks in indentation area
authorKristian Rietveld <kris@gtk.org>
Sun, 12 Dec 2010 16:32:59 +0000 (17:32 +0100)
committerKristian Rietveld <kris@gtk.org>
Sun, 12 Dec 2010 16:32:59 +0000 (17:32 +0100)
For this case, we want to set focus on the first cell in the column.

gtk/gtktreeviewcolumn.c

index fd5eb1c6cfb47577d9227a9a4c048e0c27e33927..2621cb360b3d2d26e64924a2618036d8a34cd1eb 100644 (file)
@@ -1479,6 +1479,14 @@ _gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column,
   GtkCellRenderer *match = NULL;
   GtkTreeViewColumnPrivate *priv = column->priv;
 
+  if (x < cell_area->x)
+    {
+      /* This can happen when we click in the "indentation".  In this
+       * case, we set x to cell_area->x, the start of the first cell.
+       */
+      x = cell_area->x;
+    }
+
   match = gtk_cell_area_get_cell_at_position (priv->cell_area,
                                               priv->cell_area_context,
                                               priv->tree_view,