diff options
Diffstat (limited to 'src/animate.c')
| -rw-r--r-- | src/animate.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/animate.c b/src/animate.c index 387c9b8..2f4be8d 100644 --- a/src/animate.c +++ b/src/animate.c @@ -145,7 +145,7 @@ static bool shrink_func(Animation *shrink, Layout *layout) // This part is quite rough around the edges... if (group->children->next) { g_list_free(g_list_remove_link(group->children, group->children)); - g_list_free(g_list_remove_link(layout->children, layout->children)); + g_list_free_full(g_list_remove_link(layout->children, layout->children), (GDestroyNotify)layout_destroy); layout->width = CAST(layout->children->data, Layout)->width; return true; } @@ -162,8 +162,10 @@ static bool shrink_func(Animation *shrink, Layout *layout) for (GList *it = layout->children, *next = it->next; it; it = next, next = it ? it->next : NULL) { Layout *child = it->data; - if (child->x + child->width > layout->x + width) - layout->children = g_list_delete_link(layout->children, it); + if (child->x + child->width <= layout->x + width) continue; + + layout_destroy(it->data); + layout->children = g_list_delete_link(layout->children, it); } return true; @@ -197,8 +199,10 @@ static bool grow_func(Animation *grow, Layout *layout) for (GList *it = layout->children, *next = it->next; it; it = next, next = it ? it->next : NULL) { Layout *child = it->data; - if (child->x + child->width > layout->x + width) - layout->children = g_list_delete_link(layout->children, it); + if (child->x + child->width <= layout->x + width) continue; + + layout_destroy(it->data); + layout->children = g_list_delete_link(layout->children, it); } return true; |
