diff options
author | Philip Chimento <philip@endlessm.com> | 2017-07-14 16:06:09 -0700 |
---|---|---|
committer | Philip Chimento <philip@endlessm.com> | 2017-07-14 16:58:01 -0700 |
commit | fc5373c31d3bc628fa34824ee864abb5a0141128 (patch) | |
tree | 9c3eed2270baa20e4e28f781fe72a99d9004d906 | |
parent | efc16e54a44cc0ae9470495f9d5047be07af274f (diff) |
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
-rw-r--r-- | endless/eoscustomcontainer.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 |