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. Federico Mena Quintero's avatarFederico Mena Quintero <>
parent ba88f7c6
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment