]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktreeselection.c
filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
[~andy/gtk] / gtk / gtktreeselection.c
index 8ea86dce3c3c031f192f88ec9bbd7c034ccffef7..10c9cd717a6908cf686251f22bd0ee58fb1e49d4 100644 (file)
@@ -12,9 +12,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -25,6 +23,7 @@
 #include "gtkmarshalers.h"
 #include "gtkintl.h"
 #include "gtktypebuiltins.h"
+#include "a11y/gtktreeviewaccessibleprivate.h"
 
 
 /**
@@ -55,7 +54,7 @@
  *
  * One of the important things to remember when monitoring the selection of
  * a view is that the #GtkTreeSelection::changed signal is mostly a hint.
- * That is,it may only emit one signal when a range of rows is selected.
+ * That is, it may only emit one signal when a range of rows is selected.
  * Additionally, it may on occasion emit a #GtkTreeSelection::changed signal
  * when nothing has happened (mostly as a result of programmers calling
  * select_row on an already selected row).
@@ -554,8 +553,7 @@ gtk_tree_selection_get_selected (GtkTreeSelection  *selection,
  *
  * To free the return value, use:
  * |[
- * g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
- * g_list_free (list);
+ * g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
  * ]|
  *
  * Return value: (element-type GtkTreePath) (transfer full): A #GList containing a #GtkTreePath for each selected row.
@@ -1637,7 +1635,16 @@ gtk_tree_selection_real_select_node (GtkTreeSelection *selection,
 
   if (toggle)
     {
-      node->flags ^= GTK_RBNODE_IS_SELECTED;
+      if (!GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
+        {
+          GTK_RBNODE_SET_FLAG (node, GTK_RBNODE_IS_SELECTED);
+          _gtk_tree_view_accessible_add_state (priv->tree_view, tree, node, GTK_CELL_RENDERER_SELECTED);
+        }
+      else
+        {
+          GTK_RBNODE_UNSET_FLAG (node, GTK_RBNODE_IS_SELECTED);
+          _gtk_tree_view_accessible_remove_state (priv->tree_view, tree, node, GTK_CELL_RENDERER_SELECTED);
+        }
 
       _gtk_tree_view_queue_draw_node (priv->tree_view, tree, node, NULL);