[PATCH weston 2/4] Add weston_animation_exists().

Scott Moreau oreaus at gmail.com
Thu Jun 7 08:12:30 PDT 2012


---
 src/compositor.c |    8 +++++++-
 src/compositor.h |    2 ++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 9110d4c..7f51424 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -980,6 +980,12 @@ fade_frame(struct weston_animation *animation,
 	}
 }
 
+WL_EXPORT int
+weston_animation_exists(struct weston_animation *animation)
+{
+	return wl_list_empty(&animation->link) ? 0 : 1;
+}
+
 WL_EXPORT void
 weston_animation_run(struct weston_compositor *compositor,
 			struct weston_output *output,
@@ -1204,7 +1210,7 @@ weston_compositor_fade(struct weston_compositor *compositor, float tint)
 	}
 
 	weston_surface_damage(compositor->fade.surface);
-	if (wl_list_empty(&compositor->fade.animation.link))
+	if (!weston_animation_exists(&compositor->fade.animation))
 		weston_animation_run(compositor, NULL,
 					&compositor->fade.animation);
 }
diff --git a/src/compositor.h b/src/compositor.h
index 30cb7bb..69bbbc4 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -534,6 +534,8 @@ weston_compositor_activity(struct weston_compositor *compositor);
 void
 weston_compositor_update_drag_surfaces(struct weston_compositor *compositor);
 
+int
+weston_animation_exists(struct weston_animation *animation);
 void
 weston_animation_run(struct weston_compositor *compositor,
 				struct weston_output *output,
-- 
1.7.7.6



More information about the wayland-devel mailing list