GNOME Bugzilla – Bug 94837
Spurious signal emitted when TreeView is clicked with nothing previously selected
Last modified: 2011-02-04 16:12:26 UTC
If I click on a row in a GtkTreeView which has nothing selected a changed signal is emitted by the GtkTreeSelection for the first row and then subsequently for the row which is selected.
This is not really spurious. If the treeview gets focus, and no item has been selected, it will select the first item by default (only if the selection mode != GTK_SELECTION_NONE). IMHO this behaviour is questionnable, but I'm sure Jonathan has a rationale for this (or forgot it :). So we have two options. Change the current behaviour (which may break apps), or wait for the mode API and add a special mode. I'll let Jonathan decide.
*** Bug 96063 has been marked as a duplicate of this bug. ***
*** Bug 82344 has been marked as a duplicate of this bug. ***
Setting on 2.2 API freeze. Chaging behaviour is changing API.
Jonathan wants to use the mode API here. Punting to 2.4.
*** Bug 118577 has been marked as a duplicate of this bug. ***
*** Bug 119364 has been marked as a duplicate of this bug. ***
For reference, this bug is caused by the fix to bug #113086. We don't need a modes API; we just need to move the grab_focus() call after the code which selects the pressed row.
Thanks for reporting, Fixed.