After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 302153 - treeview widget ignores GTK_CELL_RENDERER_MODE_INERT when handling focus
treeview widget ignores GTK_CELL_RENDERER_MODE_INERT when handling focus
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
unspecified
Other Linux
: Normal normal
: Small fix
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2005-04-27 11:43 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2005-06-20 07:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cursor movement in a cell honours no focusable cells (3.68 KB, patch)
2005-05-03 12:48 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2005-04-27 11:43:53 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.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2005-04-28 18:27:18 UTC
I've now tracked it down to
gtk_tree_view_move_cursor_*()
family of functions.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2005-04-28 18:39:43 UTC
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

Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2005-05-03 12:48:13 UTC
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 4 Stefan Sauer (gstreamer, gtkdoc dev) 2005-05-03 12:49:04 UTC
Comment on attachment 45980 [details] [review]
cursor movement in a cell honours no focusable cells

patch is against gtk 2.6.6
Comment 5 Jonathan Blandford 2005-05-03 22:23:23 UTC
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.
Comment 6 Kristian Rietveld 2005-06-19 23:36:35 UTC
_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.
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2005-06-20 07:17:54 UTC
Means there is now way to avoid a cell getting focused?