diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index 3a23ef47..8c847e7e 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -158,6 +158,9 @@ ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer, int32_t is_surface_transition(struct ivi_layout_surface *surface); +void +ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface); + /** * methods of interaction between ivi-shell with ivi-layout */ diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c index 3b613a5e..ed119993 100644 --- a/ivi-shell/ivi-layout-transition.c +++ b/ivi-shell/ivi-layout-transition.c @@ -99,6 +99,22 @@ is_surface_transition(struct ivi_layout_surface *surface) return 0; } +void +ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface) +{ + struct ivi_layout *layout = get_instance(); + struct transition_node *node; + struct transition_node *tmp; + struct ivi_layout_transition *tran; + + wl_list_for_each_safe(node, tmp, &layout->transitions->transition_list, link) { + tran = node->transition; + if (tran->is_transition_func(tran->private_data, surface)) { + layout_transition_destroy(tran); + } + }; +} + static void tick_transition(struct ivi_layout_transition *transition, uint32_t timestamp) { diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index c324b5eb..61897ef8 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -241,6 +241,8 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) wl_signal_emit(&layout->surface_notification.removed, ivisurf); + ivi_layout_remove_all_surface_transitions(ivisurf); + remove_configured_listener(ivisurf); ivi_layout_surface_remove_notification(ivisurf);