diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-06-09 08:59:47 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-06-09 13:31:04 -0400 |
commit | 726d603f617993c962d9c432c068b0d4d1958101 (patch) | |
tree | f5f267797920e0b0b9cdf78f17fb60eb7ec7f844 /gtk/gtkimcontext.c | |
parent | 720561475dae18460e2775aafb5a923f5b79d589 (diff) | |
download | gtk+-726d603f617993c962d9c432c068b0d4d1958101.tar.gz |
GtkIMContext: Use G_PARAM_EXPLICIT_NOTIFY
Diffstat (limited to 'gtk/gtkimcontext.c')
-rw-r--r-- | gtk/gtkimcontext.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gtk/gtkimcontext.c b/gtk/gtkimcontext.c index 5ef5854824..be0f629a11 100644 --- a/gtk/gtkimcontext.c +++ b/gtk/gtkimcontext.c @@ -332,7 +332,7 @@ gtk_im_context_class_init (GtkIMContextClass *klass) P_("Purpose of the text field"), GTK_TYPE_INPUT_PURPOSE, GTK_INPUT_PURPOSE_FREE_FORM, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY); properties[PROP_INPUT_HINTS] = g_param_spec_flags ("input-hints", @@ -340,7 +340,7 @@ gtk_im_context_class_init (GtkIMContextClass *klass) P_("Hints for the text field behaviour"), GTK_TYPE_INPUT_HINTS, GTK_INPUT_HINT_NONE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY); g_object_class_install_properties (object_class, LAST_PROPERTY, properties); } @@ -786,10 +786,18 @@ gtk_im_context_set_property (GObject *obj, switch (property_id) { case PROP_INPUT_PURPOSE: - priv->purpose = g_value_get_enum (value); + if (priv->purpose != g_value_get_enum (value)) + { + priv->purpose = g_value_get_enum (value); + g_object_notify_by_pspec (obj, pspec); + } break; case PROP_INPUT_HINTS: - priv->hints = g_value_get_flags (value); + if (priv->hints != g_value_get_flags (value)) + { + priv->hints = g_value_get_flags (value); + g_object_notify_by_pspec (obj, pspec); + } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec); |