[Xfce4-commits] [xfce/thunar] 01/01: Fix broken shortcut renaming (bug #11885)

noreply at xfce.org noreply at xfce.org
Mon May 4 11:59:50 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit b643a1ff7cb3392c013a8774f14a3302e69d91b2
Author: Harald Judt <h.judt at gmx.at>
Date:   Mon May 4 11:46:31 2015 +0200

    Fix broken shortcut renaming (bug #11885)
    
    This fixes the shortcut renaming feature broken by f60acf89a1321be
    "Allow <ctrl> + middle click in shortcut and treeview panes" and
    also removes the weird-looking "selection in selection" which maybe can
    only be noticed by some themes, but is reproducible with Greybird.
---
 thunar/thunar-shortcuts-view.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index 2e05a0a..02005bf 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -459,7 +459,7 @@ thunar_shortcuts_view_button_press_event (GtkWidget      *widget,
                 }
             }
           else
-              gtk_tree_view_set_cursor (GTK_TREE_VIEW (widget), path, NULL, FALSE);
+            gtk_tree_view_set_cursor (GTK_TREE_VIEW (widget), path, gtk_tree_view_get_column (GTK_TREE_VIEW (view), 0), FALSE);
 
           /* remember the button as pressed and handle it in the release handler */
           view->pressed_button = event->button;
@@ -1359,6 +1359,7 @@ thunar_shortcuts_view_renamed (GtkCellRenderer     *renderer,
                                ThunarShortcutsView *view)
 {
   GtkTreeModel *model;
+  GtkTreePath  *path;
   GtkTreeIter   iter;
   GtkTreeModel *child_model;
   GtkTreeIter   child_iter;
@@ -1373,6 +1374,11 @@ thunar_shortcuts_view_renamed (GtkCellRenderer     *renderer,
       child_model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
       gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_iter, &iter);
       thunar_shortcuts_model_rename (THUNAR_SHORTCUTS_MODEL (child_model), &child_iter, text);
+
+      /* unset the cell focus and only focus the column to avoid the weird-looking double selection */
+      path = gtk_tree_model_get_path (model, &iter);
+      gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, gtk_tree_view_get_column (GTK_TREE_VIEW (view), 0), FALSE);
+      gtk_tree_path_free (path);
     }
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list