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.
This commit is contained in:
Matthijs Velsink 2024-05-17 01:37:54 +02:00 committed by Felipe Borges
parent e45ae68a5b
commit 6275e1a165

View file

@ -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);
}