GNOME Bugzilla – Bug 302153
treeview widget ignores GTK_CELL_RENDERER_MODE_INERT when handling focus
Last modified: 2005-06-20 07:17:54 UTC
Set the "mode" of some cell renderers to GTK_CELL_RENDERER_MODE_INERT. Then navigate to these cells (via mouse-click or via cursor keys. The cell still gets the focus (-rectangle). The expected behaviour is that such cells are skipped. Analysis: gtk_tree_view_set_cursor_on_cell() docs say that it checks if the cells are ACTIVATABLE or EDITABLE. It calls gtk_tree_view_column_focus_cell() without actually checking if the cell s mode is not GTK_CELL_RENDERER_MODE_INERT. When grepping the whole gtk source GTK_CELL_RENDERER_MODE_INERT is never used in a condition. It is only used to initialize the mode.
I've now tracked it down to gtk_tree_view_move_cursor_*() family of functions.
the left right calls _gtk_tree_view_column_cell_focus() and this is moving the info->has_focus mark. That code has several flaws: * removing old focus before ensuring it *can* set a new focus. * not checking wheter the cell is focusable (info->cell->mode!=GTK_CELL_RENDERER_MODE_INERT) * it whould loop to find the first focusable cell in its direction
Created attachment 45980 [details] [review] cursor movement in a cell honours no focusable cells keyboard cursor movement already works, but clicking a cell with the mouse, still causes the column to get focus, even if the cell under the mouse is not focusable. This becomes visible, when pressing cursor-up/down after clicking. Will invesstigate further ...
Comment on attachment 45980 [details] [review] cursor movement in a cell honours no focusable cells patch is against gtk 2.6.6
I don't think this is quite right. Column focus is used in A11Y, even if all the cells are inert, and also for scrolling. Additionally, gtk_tree_view_set_cursor() can set it on a particular column, regardless of it's cell state.
_INERT basically means 'not editable'. If a row has one or more special cells, each individual cell, even INERT ones, can get the focus rectangle. This is the expected behaviour.
Means there is now way to avoid a cell getting focused?