summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-05-03 12:41:03 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-05-03 12:41:03 -0400
commit132c65360eae5c201f71723ebfe1b1f29d77699a (patch)
tree80a4a6b3d1316dcea2415ff05eacca0da49b4b75
parent1c5621840b3eb172a3b194d60024644bf7708217 (diff)
meego-tablet-shell: Handle animation surface going away
-rw-r--r--compositor/meego-tablet-shell.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/compositor/meego-tablet-shell.c b/compositor/meego-tablet-shell.c
index e01cc67f..44e60edc 100644
--- a/compositor/meego-tablet-shell.c
+++ b/compositor/meego-tablet-shell.c
@@ -79,6 +79,7 @@ struct meego_tablet_zoom {
struct wlsc_animation animation;
struct wlsc_spring spring;
struct wlsc_transform transform;
+ struct wl_listener listener;
};
static int
@@ -96,6 +97,18 @@ sigchld_handler(int signal_number, void *data)
}
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
meego_tablet_zoom_frame(struct wlsc_animation *animation,
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,
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,
&zoom->animation.link);
}