aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-09-11 13:01:53 -0400
committerTony Crisci <tony@dubstepdish.com>2017-09-11 13:01:53 -0400
commit74e95788892b906008e289747912353a1c1166f8 (patch)
treeda363474dd5d3b93d9951c55bb3193bbddeb221d
parent94da69a0647eb00cdb2862a88c777b78d2934874 (diff)
add surface destroy signal
-rw-r--r--include/wlr/types/wlr_surface.h1
-rw-r--r--types/wlr_surface.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h
index f0765160..0a802ea3 100644
--- a/include/wlr/types/wlr_surface.h
+++ b/include/wlr/types/wlr_surface.h
@@ -42,6 +42,7 @@ struct wlr_surface {
struct {
struct wl_signal commit;
+ struct wl_signal destroy;
} signals;
struct wl_list frame_callback_list; // wl_surface.frame
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index e733c544..9f329b7d 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -365,6 +365,7 @@ const struct wl_surface_interface surface_interface = {
static void destroy_surface(struct wl_resource *resource) {
struct wlr_surface *surface = wl_resource_get_user_data(resource);
+ wl_signal_emit(&surface->signals.destroy, surface);
wlr_texture_destroy(surface->texture);
struct wlr_frame_callback *cb, *next;
@@ -399,6 +400,7 @@ struct wlr_surface *wlr_surface_create(struct wl_resource *res,
pixman_region32_init(&surface->pending.opaque);
pixman_region32_init(&surface->pending.input);
wl_signal_init(&surface->signals.commit);
+ wl_signal_init(&surface->signals.destroy);
wl_list_init(&surface->frame_callback_list);
wl_resource_set_implementation(res, &surface_interface,
surface, destroy_surface);