From e733aa43cf74bd79dda0da6bcdb79ea1575ae660 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Jan 2018 15:35:54 -0500 Subject: [PATCH] color editor: stop using ::focus-out-event Again, the has-focus property is sufficient. --- gtk/gtkcoloreditor.c | 14 +++++++------- gtk/ui/gtkcoloreditor.ui | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gtk/gtkcoloreditor.c b/gtk/gtkcoloreditor.c index 2fc1bd46a6..9bf2108efc 100644 --- a/gtk/gtkcoloreditor.c +++ b/gtk/gtkcoloreditor.c @@ -126,13 +126,13 @@ entry_apply (GtkWidget *entry, g_free (text); } -static gboolean -entry_focus_out (GtkWidget *entry, - GdkEventFocus *event, - GtkColorEditor *editor) +static void +entry_focus_changed (GtkWidget *entry, + GParamSpec *pspec, + GtkColorEditor *editor) { - entry_apply (entry, editor); - return FALSE; + if (!gtk_widget_has_focus (entry)) + entry_apply (entry, editor); } static void @@ -487,7 +487,7 @@ gtk_color_editor_class_init (GtkColorEditorClass *class) gtk_widget_class_bind_template_callback (widget_class, get_child_position); gtk_widget_class_bind_template_callback (widget_class, entry_text_changed); gtk_widget_class_bind_template_callback (widget_class, entry_apply); - gtk_widget_class_bind_template_callback (widget_class, entry_focus_out); + gtk_widget_class_bind_template_callback (widget_class, entry_focus_changed); gtk_widget_class_bind_template_callback (widget_class, popup_edit); } diff --git a/gtk/ui/gtkcoloreditor.ui b/gtk/ui/gtkcoloreditor.ui index 725231e3c3..c38f771511 100644 --- a/gtk/ui/gtkcoloreditor.ui +++ b/gtk/ui/gtkcoloreditor.ui @@ -60,7 +60,7 @@ - +