text widgets: Don't lose focus after Emoji

Make sure to grab focus back when the Emoji chooser
disappears. This prevents focus going nowhere when
the Emoji chooser is canceled.

Fixes: #3112
This commit is contained in:
Matthias Clasen 2020-09-02 10:26:13 -04:00
parent 9512e461d5
commit d5121af876
2 changed files with 2 additions and 0 deletions

View File

@ -6825,6 +6825,7 @@ gtk_text_insert_emoji (GtkText *self)
gtk_widget_set_parent (chooser, GTK_WIDGET (self));
g_signal_connect (chooser, "emoji-picked", G_CALLBACK (emoji_picked), self);
g_signal_connect_swapped (chooser, "hide", G_CALLBACK (gtk_widget_grab_focus), self);
}
gtk_popover_popup (GTK_POPOVER (chooser));

View File

@ -9637,6 +9637,7 @@ gtk_text_view_insert_emoji (GtkTextView *text_view)
gtk_widget_set_parent (chooser, GTK_WIDGET (text_view));
g_signal_connect (chooser, "emoji-picked", G_CALLBACK (emoji_picked), text_view);
g_signal_connect_swapped (chooser, "hide", G_CALLBACK (gtk_widget_grab_focus), text_view);
}
buffer = get_buffer (text_view);