From 61f91c7cd2e18809bc1e38a407af482230226c75 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 16 Nov 2016 13:02:09 +0100 Subject: [PATCH] app: be more deterministic in a list view's name column (name editing etc.) We handle multi-selection by letting GtkTreeView handle button press when the widget is in GTK_SELECTION_MULTIPLE mode. Change that code to only do that when one of the participating modifiers (shift and control on Linux and Windows, shift and cmd on macOS) is pressed. This makes sure that the same thing is not randomly handled by two different pieces of code, and probably fixes bug #738440, tho I can't be sure. --- app/widgets/gimpcontainertreeview.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c index 92712ca6fd..87e6a24a2c 100644 --- a/app/widgets/gimpcontainertreeview.c +++ b/app/widgets/gimpcontainertreeview.c @@ -1061,6 +1061,17 @@ gimp_container_tree_view_button_press (GtkWidget *widget, multisel_mode = (gtk_tree_selection_get_mode (tree_view->priv->selection) == GTK_SELECTION_MULTIPLE); + if (! (bevent->state & (gimp_get_extend_selection_mask () | + gimp_get_modify_selection_mask ()))) + { + /* don't chain up for multi-selection handling if none of + * the participating modifiers is pressed, we implement + * button_press completely ourselves for a reason and don't + * want the default implementation mess up our state + */ + multisel_mode = FALSE; + } + gtk_tree_model_get_iter (tree_view->model, &iter, path); gtk_tree_model_get (tree_view->model, &iter,