From fc5373c31d3bc628fa34824ee864abb5a0141128 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 14 Jul 2017 16:06:09 -0700 Subject: customcontainer: Queue resize if visible child removed All custom containers previously needed to do this in Javascript, but that caused problems: garbage collection could cause widgets to be removed, and you cannot trigger Javascript code to run during garbage collection. https://phabricator.endlessm.com/T18286 --- endless/eoscustomcontainer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'endless') diff --git a/endless/eoscustomcontainer.c b/endless/eoscustomcontainer.c index bf739e4..199a6c3 100644 --- a/endless/eoscustomcontainer.c +++ b/endless/eoscustomcontainer.c @@ -67,8 +67,13 @@ eos_custom_container_remove (GtkContainer *container, EosCustomContainer *self = EOS_CUSTOM_CONTAINER (container); EosCustomContainerPrivate *priv = eos_custom_container_get_instance_private (self); + gboolean needs_resize = gtk_widget_get_visible (child); + priv->children = g_list_remove (priv->children, child); gtk_widget_unparent (child); + + if (needs_resize) + gtk_widget_queue_resize (GTK_WIDGET (container)); } static void -- cgit v1.2.3