diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2020-12-17 15:51:04 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2020-12-17 15:51:04 +0000 |
commit | ec94ec0286041c16d6df7b496b0760a0ae0885ba (patch) | |
tree | a1719eab9c76fbbbc6588d5c444b1756c06a41f8 | |
parent | e9e09be37ef184794901dadb6bac2c07a20da0ee (diff) | |
parent | e71f6b0bc073584015e9bd5ea77ad9557ff61be8 (diff) | |
download | gtk+-ec94ec0286041c16d6df7b496b0760a0ae0885ba.tar.gz |
Merge branch 'ebassi/password-entry-notify' into 'master'
Notify properties on deletion in PasswordEntryBuffer
Closes #3484
See merge request GNOME/gtk!2969
-rw-r--r-- | gtk/gtkeditable.c | 12 | ||||
-rw-r--r-- | gtk/gtkpasswordentrybuffer.c | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index eae161c542..48ae98dd20 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -133,8 +133,8 @@ * } * ]| * - * Finally, use gtk_editable_delegate_set_property() in your set_property - * function (and similar for get_property), to set the editable properties: + * Finally, use gtk_editable_delegate_set_property() in your `set_property` + * function (and similar for `get_property`), to set the editable properties: * * |[ * ... @@ -144,6 +144,14 @@ * switch (prop_id) * ... * ]| + * + * It is important to note that if you create a GtkEditable that uses a delegate, + * the low level #GtkEditable::insert-text and #GtkEditable::delete-text signals + * will be propagated from the "wrapper" editable to the delegate, but they will + * not be propagated from the delegate to the "wrapper" editable, as they would + * cause an infinite recursion. If you wish to connect to the #GtkEditable::insert-text + * and #GtkEditable::delete-text signals, you will need to connect to them on + * the delegate obtained via gtk_editable_get_delegate(). */ #include "config.h" diff --git a/gtk/gtkpasswordentrybuffer.c b/gtk/gtkpasswordentrybuffer.c index 2c97417f26..bc9cc0daa9 100644 --- a/gtk/gtkpasswordentrybuffer.c +++ b/gtk/gtkpasswordentrybuffer.c @@ -135,6 +135,9 @@ gtk_password_entry_buffer_real_deleted_text (GtkEntryBuffer *buffer, memmove (self->text + start, self->text + end, self->text_bytes + 1 - end); self->text_chars -= n_chars; self->text_bytes -= (end - start); + + g_object_notify (G_OBJECT (buffer), "text"); + g_object_notify (G_OBJECT (buffer), "length"); } static guint |