treeview: Check the selected node active flag before maybe starting rubberband

This check used to be present in the pre-gestures code, but was unintentionally
removed when splitting code into drag/multiclick gestures. The policy used to
be that if clicking happened on an already selected node, DnD would happen
instead of rubberband selection, so this behavior is resuscitated.

https://bugzilla.gnome.org/show_bug.cgi?id=734143
This commit is contained in:
Carlos Garnacho 2014-08-11 18:02:12 +02:00
parent 13b8c2ec28
commit b56f5cec3e

View File

@ -3328,13 +3328,18 @@ gtk_tree_view_drag_gesture_begin (GtkGestureDrag *gesture,
GtkTreeView *tree_view)
{
gint bin_x, bin_y;
GtkRBTree *tree;
GtkRBNode *node;
gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y,
&bin_x, &bin_y);
tree_view->priv->press_start_x = tree_view->priv->rubber_band_x = bin_x;
tree_view->priv->press_start_y = tree_view->priv->rubber_band_y = bin_y;
_gtk_rbtree_find_offset (tree_view->priv->tree, bin_y + tree_view->priv->dy,
&tree, &node);
if (tree_view->priv->rubber_banding_enable
&& !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED)
&& gtk_tree_selection_get_mode (tree_view->priv->selection) == GTK_SELECTION_MULTIPLE)
{
gboolean modify, extend;