aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2022-05-31 21:39:53 +0300
committerIsaac Freund <mail@isaacfreund.com>2022-06-01 09:49:25 +0000
commitd3bc17d5d1712cb445598d5fbfd40574661b2568 (patch)
tree88f363932ebc2fc52829efb057ae790be0d4af5c
parentec328ca8cc82f5cac657141e31a81a590759150d (diff)
scene: add wlr_scene_output.events.destroy
-rw-r--r--include/wlr/types/wlr_scene.h4
-rw-r--r--types/scene/wlr_scene.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h
index 38a2e478..4b8ea517 100644
--- a/include/wlr/types/wlr_scene.h
+++ b/include/wlr/types/wlr_scene.h
@@ -164,6 +164,10 @@ struct wlr_scene_output {
int x, y;
+ struct {
+ struct wl_signal destroy;
+ } events;
+
// private state
uint8_t index;
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c
index 67894134..8f9d0369 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -999,6 +999,8 @@ struct wlr_scene_output *wlr_scene_output_create(struct wlr_scene *scene,
assert(scene_output->index < 64);
wl_list_insert(prev_output_link, &scene_output->link);
+ wl_signal_init(&scene_output->events.destroy);
+
scene_output->output_commit.notify = scene_output_handle_commit;
wl_signal_add(&output->events.commit, &scene_output->output_commit);
@@ -1035,6 +1037,8 @@ void wlr_scene_output_destroy(struct wlr_scene_output *scene_output) {
return;
}
+ wlr_signal_emit_safe(&scene_output->events.destroy, NULL);
+
scene_node_remove_output(&scene_output->scene->tree.node, scene_output);
wlr_addon_finish(&scene_output->addon);