forked from AuroraMiddleware/gtk
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master Closes #2979 See merge request GNOME/gtk!2474
This commit is contained in:
commit
9729a060f5
@ -999,6 +999,16 @@ keynav_failed (GtkWidget *box,
|
|||||||
return FALSE;
|
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
|
static void
|
||||||
gtk_emoji_chooser_class_init (GtkEmojiChooserClass *klass)
|
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;
|
object_class->finalize = gtk_emoji_chooser_finalize;
|
||||||
widget_class->show = gtk_emoji_chooser_show;
|
widget_class->show = gtk_emoji_chooser_show;
|
||||||
|
widget_class->map = gtk_emoji_chooser_map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkEmojiChooser::emoji-picked:
|
* GtkEmojiChooser::emoji-picked:
|
||||||
|
@ -326,6 +326,9 @@ static void gtk_text_snapshot (GtkWidget *widget,
|
|||||||
GtkSnapshot *snapshot);
|
GtkSnapshot *snapshot);
|
||||||
static void gtk_text_focus_in (GtkWidget *widget);
|
static void gtk_text_focus_in (GtkWidget *widget);
|
||||||
static void gtk_text_focus_out (GtkWidget *widget);
|
static void gtk_text_focus_out (GtkWidget *widget);
|
||||||
|
static void gtk_text_focus_changed (GtkEventControllerFocus *focus,
|
||||||
|
GParamSpec *pspec,
|
||||||
|
GtkWidget *widget);
|
||||||
static gboolean gtk_text_grab_focus (GtkWidget *widget);
|
static gboolean gtk_text_grab_focus (GtkWidget *widget);
|
||||||
static void gtk_text_css_changed (GtkWidget *widget,
|
static void gtk_text_css_changed (GtkWidget *widget,
|
||||||
GtkCssStyleChange *change);
|
GtkCssStyleChange *change);
|
||||||
@ -1894,10 +1897,8 @@ gtk_text_init (GtkText *self)
|
|||||||
|
|
||||||
controller = gtk_event_controller_focus_new ();
|
controller = gtk_event_controller_focus_new ();
|
||||||
gtk_event_controller_set_name (controller, "gtk-text-focus-controller");
|
gtk_event_controller_set_name (controller, "gtk-text-focus-controller");
|
||||||
g_signal_connect_swapped (controller, "enter",
|
g_signal_connect (controller, "notify::is-focus",
|
||||||
G_CALLBACK (gtk_text_focus_in), self);
|
G_CALLBACK (gtk_text_focus_changed), self);
|
||||||
g_signal_connect_swapped (controller, "leave",
|
|
||||||
G_CALLBACK (gtk_text_focus_out), self);
|
|
||||||
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
||||||
|
|
||||||
widget_node = gtk_widget_get_css_node (GTK_WIDGET (self));
|
widget_node = gtk_widget_get_css_node (GTK_WIDGET (self));
|
||||||
@ -3196,6 +3197,17 @@ gtk_text_focus_out (GtkWidget *widget)
|
|||||||
gtk_text_check_cursor_blink (self);
|
gtk_text_check_cursor_blink (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_text_focus_changed (GtkEventControllerFocus *controller,
|
||||||
|
GParamSpec *pspec,
|
||||||
|
GtkWidget *widget)
|
||||||
|
{
|
||||||
|
if (gtk_event_controller_focus_is_focus (controller))
|
||||||
|
gtk_text_focus_in (widget);
|
||||||
|
else
|
||||||
|
gtk_text_focus_out (widget);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gtk_text_grab_focus (GtkWidget *widget)
|
gtk_text_grab_focus (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user