diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-01-30 12:29:33 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-01-30 12:29:33 +0000 |
commit | 442cd4a3696ea3d607c4328ea13615128795aade (patch) | |
tree | 40371e7998de159a83f8cb9cec79025da525b695 | |
parent | c43e1f3d0a8ef30146d2085fa2775ebff65ef25b (diff) | |
parent | 53af41e2fa50ea23057b324ff222c86560924282 (diff) | |
download | gtk+-442cd4a3696ea3d607c4328ea13615128795aade.tar.gz |
Merge branch 'password-entry-unrealize' into 'main'
passwordentry: Fix an asymmetry
Closes #5285
See merge request GNOME/gtk!5457
-rw-r--r-- | gtk/gtkpasswordentry.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c index 5fe1346dd6..b540a27fca 100644 --- a/gtk/gtkpasswordentry.c +++ b/gtk/gtkpasswordentry.c @@ -251,12 +251,23 @@ gtk_password_entry_realize (GtkWidget *widget) } static void -gtk_password_entry_dispose (GObject *object) +gtk_password_entry_unrealize (GtkWidget *widget) { - GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (object); + GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (widget); if (entry->keyboard) - g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry); + { + g_signal_handlers_disconnect_by_func (entry->keyboard, caps_lock_state_changed, entry); + entry->keyboard = NULL; + } + + GTK_WIDGET_CLASS (gtk_password_entry_parent_class)->unrealize (widget); +} + +static void +gtk_password_entry_dispose (GObject *object) +{ + GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (object); if (entry->entry) gtk_editable_finish_delegate (GTK_EDITABLE (entry)); @@ -448,6 +459,7 @@ gtk_password_entry_class_init (GtkPasswordEntryClass *klass) object_class->set_property = gtk_password_entry_set_property; widget_class->realize = gtk_password_entry_realize; + widget_class->unrealize = gtk_password_entry_unrealize; widget_class->measure = gtk_password_entry_measure; widget_class->size_allocate = gtk_password_entry_size_allocate; widget_class->mnemonic_activate = gtk_password_entry_mnemonic_activate; |