From df0191ae94dbae2f451a57c2710e23319b7a67e5 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 9 May 2007 00:49:20 +0100 Subject: Set focus on the search entry When switching to search mode via key bindings, let the search entry grab the focus instead of the file list (which should be empty anyway). Signed-off-by: Emmanuele Bassi --- gtk/gtkfilechooserdefault.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 2c4c159..9d1ecb5 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -10535,7 +10535,15 @@ static void search_shortcut_handler (GtkFileChooserDefault *impl) { if (impl->has_search) - switch_to_shortcut (impl, shortcuts_get_index (impl, SHORTCUTS_SEARCH)); + { + switch_to_shortcut (impl, shortcuts_get_index (impl, SHORTCUTS_SEARCH)); + + /* we want the entry widget to grab the focus the first + * time, not the browse_files_tree_view widget. + */ + if (impl->search_entry) + gtk_widget_grab_focus (impl->search_entry); + } } /* Handler for the "recent-shortcut" keybinding signal */ -- 1.4.4.2