summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserwidget.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-02 19:18:11 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-02 19:18:11 -0400
commit9605e49fbf5c34bb9558025291b63ff113a3cc6b (patch)
treeaed0a9fbeccce88ab8b20fbad5489d792f50d00d /gtk/gtkfilechooserwidget.c
parent7fe7d5ab4ffa2d531ce2caa9ad780ef419b4d440 (diff)
downloadgtk+-9605e49fbf5c34bb9558025291b63ff113a3cc6b.tar.gz
filechooser: Prevent over-eager completions
We don't want the completions to pop up after we call gtk_file_chooser_set_current_name(). This used to be handled by gtk_entry_set_text() blocking the completion signal handler. We don't have that anymore, so block popup completion around the call to gtk_editable_set_text() instead. Fixes: #2995
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r--gtk/gtkfilechooserwidget.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 3509cf7cf7..2eae39493c 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -5088,11 +5088,18 @@ gtk_file_chooser_widget_set_current_name (GtkFileChooser *chooser,
const char *name)
{
GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser);
+ GtkEntryCompletion *completion;
g_return_if_fail (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE);
pending_select_files_free (impl);
+
+ completion = gtk_entry_get_completion (GTK_ENTRY (impl->location_entry));
+ gtk_entry_completion_set_popup_completion (completion, FALSE);
+
gtk_editable_set_text (GTK_EDITABLE (impl->location_entry), name);
+
+ gtk_entry_completion_set_popup_completion (completion, TRUE);
}
static char *