From 37433a3de5edbe1735b3f5e79a58257d4cbfbba9 Mon Sep 17 00:00:00 2001 From: Theo Linkspfeifer Date: Tue, 18 Feb 2020 12:45:44 +0100 Subject: [PATCH] Fix pathbar match filtering (Bug #16267) --- thunar/thunar-path-entry.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/thunar/thunar-path-entry.c b/thunar/thunar-path-entry.c index 48fa5fb0..007713a2 100644 --- a/thunar/thunar-path-entry.c +++ b/thunar/thunar-path-entry.c @@ -893,13 +893,14 @@ thunar_path_entry_match_func (GtkEntryCompletion *completion, GtkTreeIter *iter, gpointer user_data) { - GtkTreeModel *model; - const gchar *last_slash; - ThunarFile *file; - gboolean matched; - gchar *text_normalized; - gchar *name_normalized; - gchar *name; + GtkTreeModel *model; + ThunarPathEntry *path_entry = THUNAR_PATH_ENTRY (user_data); + const gchar *last_slash; + ThunarFile *file; + gboolean matched; + gchar *text_normalized; + gchar *name_normalized; + gchar *name; /* determine the model from the completion */ model = gtk_entry_completion_get_model (completion); @@ -909,9 +910,13 @@ thunar_path_entry_match_func (GtkEntryCompletion *completion, if (G_UNLIKELY (model == NULL)) return FALSE; + /* leave if the auto completion highlight was not cleared yet, to prevent + * https://bugzilla.xfce.org/show_bug.cgi?id=16267. */ + if (G_UNLIKELY (path_entry->has_completion)) + return FALSE; + /* determine the current text (UTF-8 normalized) */ text_normalized = g_utf8_normalize (gtk_entry_get_text (GTK_ENTRY (user_data)), -1, G_NORMALIZE_ALL); - /* lookup the last slash character in the key */ last_slash = strrchr (text_normalized, G_DIR_SEPARATOR); if (G_UNLIKELY (last_slash != NULL && last_slash[1] == '\0')) -- 2.25.0