[gtk/ebassi/password-entry-notify] Notify properties on deletion in PasswordEntryBuffer




commit 1738724e4a9dfe8a8d3e8f7209e24c2afcf77560
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Dec 17 15:01:35 2020 +0000

    Notify properties on deletion in PasswordEntryBuffer
    
    The GtkEntryBufferClass.deleted_text() behaviour changed between GTK3
    and GTK4, which means any subclass of GtkEntryBuffer is now responsible
    for emitting the "notify" signal for the "text" and "length" properties.
    
    Without this, the GtkText delegate widget used by GtkPasswordEntry would
    not be able to communicate changes in the contents of its buffer.
    
    Fixes: #3484

 gtk/gtkpasswordentrybuffer.c | 3 +++
 1 file changed, 3 insertions(+)
---
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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]