From 66e0f8505e9d5ed17566e69127589b7c992254fd Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 24 Aug 2020 18:31:08 -0400 Subject: [PATCH] emojichooser: Grab focus on map This is the right thing to do, since we have a visible entry and want text input to go there. --- gtk/gtkemojichooser.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 6275a088f0..62a8e19f5a 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -999,6 +999,16 @@ keynav_failed (GtkWidget *box, return FALSE; } +static void +gtk_emoji_chooser_map (GtkWidget *widget) +{ + GtkEmojiChooser *chooser = GTK_EMOJI_CHOOSER (widget); + + GTK_WIDGET_CLASS (gtk_emoji_chooser_parent_class)->map (widget); + + gtk_widget_grab_focus (chooser->search_entry); +} + static void gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass) { @@ -1007,6 +1017,7 @@ gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass) object_class->finalize = gtk_emoji_chooser_finalize; widget_class->show = gtk_emoji_chooser_show; + widget_class->map = gtk_emoji_chooser_map; /** * GtkEmojiChooser::emoji-picked: