[gtk/matthiasc/for-master: 1/2] emojichooser: Grab focus on map




commit 66e0f8505e9d5ed17566e69127589b7c992254fd
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 24 18:31:08 2020 -0400

    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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]