[gtk/mcatanzaro/unparent-warning: 5/5] listbox: unparent new header only if it has a parent
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/mcatanzaro/unparent-warning: 5/5] listbox: unparent new header only if it has a parent
- Date: Thu, 7 Jan 2021 17:39:17 +0000 (UTC)
commit b26348710d1872c0103f5ca74d46412f6fe544c4
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Thu Jan 7 10:26:03 2021 -0600
listbox: unparent new header only if it has a parent
It's no longer OK to unparent a widget that has no parent.
gtk/gtklistbox.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]