meego-tablet-shell: Handle animation surface going away

This commit is contained in:
Kristian Høgsberg
2011-05-03 12:41:03 -04:00
parent 1c5621840b
commit 132c65360e
+17
View File
@@ -79,6 +79,7 @@ struct meego_tablet_zoom {
struct wlsc_animation animation; struct wlsc_animation animation;
struct wlsc_spring spring; struct wlsc_spring spring;
struct wlsc_transform transform; struct wlsc_transform transform;
struct wl_listener listener;
}; };
static int static int
@@ -95,6 +96,18 @@ sigchld_handler(int signal_number, void *data)
return 1; return 1;
} }
static void
handle_zoom_surface_destroy(struct wl_listener *listener,
struct wl_surface *surface, uint32_t time)
{
struct meego_tablet_zoom *zoom =
container_of(listener, struct meego_tablet_zoom, listener);
wl_list_remove(&zoom->animation.link);
fprintf(stderr, "animation surface gone\n");
free(zoom);
}
static void static void
meego_tablet_zoom_frame(struct wlsc_animation *animation, meego_tablet_zoom_frame(struct wlsc_animation *animation,
struct wlsc_output *output, uint32_t msecs) struct wlsc_output *output, uint32_t msecs)
@@ -150,6 +163,10 @@ meego_tablet_zoom_run(struct meego_tablet_shell *shell,
meego_tablet_zoom_frame(&zoom->animation, NULL, meego_tablet_zoom_frame(&zoom->animation, NULL,
zoom->spring.timestamp); zoom->spring.timestamp);
zoom->listener.func = handle_zoom_surface_destroy;
wl_list_insert(surface->surface.destroy_listener_list.prev,
&zoom->listener.link);
wl_list_insert(shell->compositor->animation_list.prev, wl_list_insert(shell->compositor->animation_list.prev,
&zoom->animation.link); &zoom->animation.link);
} }