diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2021-01-07 10:26:03 -0600 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2021-01-07 11:39:41 -0600 |
commit | b26348710d1872c0103f5ca74d46412f6fe544c4 (patch) | |
tree | 9ae5f8586531f91145712629993a945e44b73b59 | |
parent | db059847b246fbea1e6db0b38db9aaeec7ab4e36 (diff) | |
download | gtk+-mcatanzaro/unparent-warning.tar.gz |
listbox: unparent new header only if it has a parentmcatanzaro/unparent-warning
It's no longer OK to unparent a widget that has no parent.
-rw-r--r-- | gtk/gtklistbox.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 72bc7c8539..a960793707 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -2232,7 +2232,8 @@ gtk_list_box_update_header (GtkListBox *box, if (new_header != NULL) { g_hash_table_insert (box->header_hash, new_header, row); - gtk_widget_unparent (new_header); + if (gtk_widget_get_parent (new_header) != NULL) + gtk_widget_unparent (new_header); gtk_widget_set_parent (new_header, GTK_WIDGET (box)); gtk_widget_show (new_header); } |