diff options
author | Federico Mena Quintero <federico@gnome.org> | 2013-06-21 18:34:31 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2013-06-21 18:35:28 -0500 |
commit | 9162589b5af83a36bdfe8929dfb6465c69df2909 (patch) | |
tree | b25a4e3046fe0b64f498b4155902e0d154c00836 /gtk/gtkfilechooserentry.c | |
parent | ba88f7c65b0d4ad0b14cd824fab815e4039997cf (diff) | |
download | gtk+-9162589b5af83a36bdfe8929dfb6465c69df2909.tar.gz |
GtkFileChooserEntry: don't inline-complete if the entry doesn't have the focus
When the file chooser changes directories, it tells the GtkFileChooserEntry to
change its base folder (i.e. the folder from which relative pathnames are resolved).
GtkFileChooserEntry then starts loading a GtkFileSystemModel asynchronously.
In the finished_loading_cb(), however, it would always ask the GtkEntryCompletion
to insert the completion prefix, since that finished_loading_cb() is what is also used
while the user is typing *in the entry*.
But when the entry doesn't have the focus (e.g. the user changed directories by double-clicking
on the file list in the file chooser), there's no reason to insert completions at all.
https://bugzilla.gnome.org/show_bug.cgi?id=672271
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Diffstat (limited to 'gtk/gtkfilechooserentry.c')
-rw-r--r-- | gtk/gtkfilechooserentry.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index ce2b6cc9e7..013947ea02 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -548,8 +548,12 @@ finished_loading_cb (GtkFileSystemModel *model, completion = gtk_entry_get_completion (GTK_ENTRY (chooser_entry)); update_inline_completion (chooser_entry); - gtk_entry_completion_complete (completion); - gtk_entry_completion_insert_prefix (completion); + + if (gtk_widget_has_focus (GTK_WIDGET (chooser_entry))) + { + gtk_entry_completion_complete (completion); + gtk_entry_completion_insert_prefix (completion); + } } static void |