diff options
author | emersion <contact@emersion.fr> | 2018-02-01 15:04:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-01 15:04:54 +0100 |
commit | 42ec696b82bfd7ab5f6d0804b4c5f7a681543c50 (patch) | |
tree | 023e06b9198c71bc748d0efb4f2537d26c3fa094 | |
parent | 429f06d3f16c0401bb8a4acfbfc239b2745c9496 (diff) | |
parent | 8eed857292cd5b473a07920b1a5698f1e641da22 (diff) |
Merge pull request #599 from emersion/output-cursor-destroy-signal
output: add destroy signal for wlr_output_cursor
-rw-r--r-- | include/wlr/types/wlr_output.h | 4 | ||||
-rw-r--r-- | types/wlr_output.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 55431ab1..9df2001e 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -29,6 +29,10 @@ struct wlr_output_cursor { struct wlr_surface *surface; struct wl_listener surface_commit; struct wl_listener surface_destroy; + + struct { + struct wl_signal destroy; + } events; }; struct wlr_output_impl; diff --git a/types/wlr_output.c b/types/wlr_output.c index 426926ac..2bdbbfee 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -694,6 +694,7 @@ struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output) { return NULL; } cursor->output = output; + wl_signal_init(&cursor->events.destroy); wl_list_init(&cursor->surface_commit.link); cursor->surface_commit.notify = output_cursor_handle_commit; wl_list_init(&cursor->surface_destroy.link); @@ -707,6 +708,7 @@ void wlr_output_cursor_destroy(struct wlr_output_cursor *cursor) { return; } output_cursor_reset(cursor); + wl_signal_emit(&cursor->events.destroy, cursor); if (cursor->output->hardware_cursor == cursor) { // If this cursor was the hardware cursor, disable it if (cursor->output->impl->set_cursor) { |