From 6275e1a165cc9c48894b583efd3e0c14a5524f83 Mon Sep 17 00:00:00 2001 From: Matthijs Velsink Date: Fri, 17 May 2024 01:37:54 +0200 Subject: [PATCH] ce-8021x-security-page: Don't manually unparent child Commit 340ee1dc fixed #1671, but the real cause of that issue was that the widget is part of a GtkBox, which will always automatically unparent child widgets. That caused #1671. Also, the check for the parent is a left-over from the GTK3 days, and its GtkContainer usage. In GTK4 there is no way a new widget will already be inside the GtkBox to begin with. So, don't unparent the widget at all, and stop checking for its parent. --- panels/network/connection-editor/ce-page-8021x-security.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/panels/network/connection-editor/ce-page-8021x-security.c b/panels/network/connection-editor/ce-page-8021x-security.c index 402d4d9b8..db309de96 100644 --- a/panels/network/connection-editor/ce-page-8021x-security.c +++ b/panels/network/connection-editor/ce-page-8021x-security.c @@ -77,8 +77,6 @@ finish_setup (CEPage8021xSecurity *self, gpointer unused, GError *error, gpointe } g_signal_connect_object (NMA_WS (self->security), "ws-changed", G_CALLBACK (security_item_changed_cb), self, G_CONNECT_SWAPPED); - if (gtk_widget_get_parent (GTK_WIDGET (self->security))) - gtk_box_remove (self->box, GTK_WIDGET (self->security)); gtk_switch_set_active (self->enable_8021x_switch, self->initial_have_8021x); g_signal_connect_object (self->enable_8021x_switch, "notify::active", G_CALLBACK (enable_toggled), self, G_CONNECT_SWAPPED); @@ -156,11 +154,6 @@ ce_page_8021x_security_dispose (GObject *object) g_clear_object (&self->connection); g_clear_object (&self->group); - if (self->security != NULL) { - gtk_widget_unparent (GTK_WIDGET (self->security)); - self->security = NULL; - } - G_OBJECT_CLASS (ce_page_8021x_security_parent_class)->dispose (object); }