Updating branch refs/heads/master
         to dad4b28048ee3267309ba98de5c176215e51a19a (commit)
       from c4a1416508e62e20ed1be3ecbe5842bad0155822 (commit)

commit dad4b28048ee3267309ba98de5c176215e51a19a
Author: Nick Schermer <[email protected]>
Date:   Sun Apr 22 18:30:30 2012 +0200

    Only focus view if an item is selected on entry active.

 src/appfinder-window.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/appfinder-window.c b/src/appfinder-window.c
index bb1b537..2ab4fa1 100644
--- a/src/appfinder-window.c
+++ b/src/appfinder-window.c
@@ -1109,6 +1109,7 @@ xfce_appfinder_window_entry_activate (GtkEditable         
*entry,
                                       XfceAppfinderWindow *window)
 {
   GtkTreePath *path;
+  gboolean     cursor_set = FALSE;
 
   if (gtk_widget_get_visible (window->paned))
     {
@@ -1118,6 +1119,8 @@ xfce_appfinder_window_entry_activate (GtkEditable         
*entry,
             {
               gtk_tree_view_set_cursor (GTK_TREE_VIEW (window->view), path, 
NULL, FALSE);
               gtk_tree_path_free (path);
+
+              cursor_set = TRUE;
             }
         }
       else if (gtk_icon_view_get_visible_range (GTK_ICON_VIEW (window->view), 
&path, NULL))
@@ -1125,9 +1128,12 @@ xfce_appfinder_window_entry_activate (GtkEditable        
 *entry,
           gtk_icon_view_select_path (GTK_ICON_VIEW (window->view), path);
           gtk_icon_view_set_cursor (GTK_ICON_VIEW (window->view), path, NULL, 
FALSE);
           gtk_tree_path_free (path);
+
+          cursor_set = TRUE;
         }
 
-      gtk_widget_grab_focus (window->view);
+      if (cursor_set)
+        gtk_widget_grab_focus (window->view);
     }
   else if (gtk_widget_get_sensitive (window->button_launch))
     {
_______________________________________________
Xfce4-commits mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to