[PATCH weston 11/12] compositor: add weston_surface:commit_signal

Pekka Paalanen ppaalanen at gmail.com
Wed Oct 10 02:49:33 PDT 2012


If you need to to hook up futher state latching to the wl_surface.commit
for a specific surface, use this.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 src/compositor.c |    3 +++
 src/compositor.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index f4c933e..51ad616 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -267,6 +267,7 @@ weston_surface_create(struct weston_compositor *compositor)
 	pixman_region32_init(&surface->pending.opaque);
 	region_init_infinite(&surface->pending.input);
 	wl_list_init(&surface->pending.frame_callback_list);
+	wl_signal_init(&surface->commit_signal);
 
 	return surface;
 }
@@ -1267,6 +1268,8 @@ surface_commit(struct wl_client *client, struct wl_resource *resource)
 			    &surface->pending.frame_callback_list);
 	wl_list_init(&surface->pending.frame_callback_list);
 
+	wl_signal_emit(&surface->commit_signal, surface);
+
 	weston_surface_schedule_repaint(surface);
 }
 
diff --git a/src/compositor.h b/src/compositor.h
index 4c61db7..c17c398 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -487,6 +487,7 @@ struct weston_surface {
 		/* wl_surface.frame */
 		struct wl_list frame_callback_list;
 	} pending;
+	struct wl_signal commit_signal;
 
 	/*
 	 * If non-NULL, this function will be called on surface::attach after
-- 
1.7.8.6



More information about the wayland-devel mailing list