From 056a07306195a6a5fb2cc4466f6719a517f5181c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 12 Nov 2020 19:04:42 +0100 Subject: [PATCH] searchbar: Fix clearing search entry on hide Commit fa3d1940bf2b36 added separate grab handling for GtkSearchEntry, but didn't consider whether the bar was revealed or concealed. The expected behavior for the latter is that the entry is cleared rather than focused, fix the condition accordingly. --- gtk/gtksearchbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c index 42fdeb2894..d7590bb707 100644 --- a/gtk/gtksearchbar.c +++ b/gtk/gtksearchbar.c @@ -171,7 +171,7 @@ reveal_child_changed_cb (GObject *object, { if (reveal_child && GTK_IS_ENTRY (bar->entry)) gtk_entry_grab_focus_without_selecting (GTK_ENTRY (bar->entry)); - else if (GTK_IS_SEARCH_ENTRY (bar->entry)) + else if (reveal_child && GTK_IS_SEARCH_ENTRY (bar->entry)) gtk_widget_grab_focus (bar->entry); else gtk_editable_set_text (GTK_EDITABLE (bar->entry), "");