[gimp] app: be more deterministic in a list view's name column (name editing etc.)



commit 61f91c7cd2e18809bc1e38a407af482230226c75
Author: Michael Natterer <mitch gimp org>
Date:   Wed Nov 16 13:02:09 2016 +0100

    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 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 92712ca..87e6a24 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]