From ac1d86b3cd812697f1d0af0fc01d6fba28b6cca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Thu, 21 Apr 2022 09:25:28 +0100 Subject: [PATCH] query-editor: Fix focus grab We have been calling gtk_entry_grab_focus_without_selecting(), but GtkSearchEntry is not a GtkEntry subclass in GTK 4, so it fails. GtkSearchEntry doesn't have an equivalent method because that's its default focus behavior. So, gtk_widget_grab_focus() just works. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2094 --- src/nautilus-query-editor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c index 98d69f3b0f..109022a077 100644 --- a/src/nautilus-query-editor.c +++ b/src/nautilus-query-editor.c @@ -154,8 +154,7 @@ nautilus_query_editor_grab_focus (GtkWidget *widget) if (gtk_widget_get_visible (widget) && !gtk_widget_is_focus (editor->entry)) { - /* avoid selecting the entry text */ - return gtk_entry_grab_focus_without_selecting (GTK_ENTRY (editor->entry)); + return gtk_widget_grab_focus (editor->entry); } return FALSE; -- GitLab