[PATCH 1/2] clipboard: add seat destroy signal handler
Kristian Høgsberg
hoegsberg at gmail.com
Wed Jul 11 12:44:45 PDT 2012
On Wed, Jul 11, 2012 at 06:48:12PM +0200, Rafal Mielniczuk wrote:
> ---
> src/clipboard.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
Thanks, applied.
> diff --git a/src/clipboard.c b/src/clipboard.c
> index 22d4b26..689e563 100644
> --- a/src/clipboard.c
> +++ b/src/clipboard.c
> @@ -243,6 +243,17 @@ clipboard_set_selection(struct wl_listener *listener, void *data)
> return;
> }
>
> +static void
> +clipboard_destroy(struct wl_listener *listener, void *data)
> +{
> + struct clipboard *clipboard =
> + container_of(listener, struct clipboard, destroy_listener);
> +
> + wl_list_remove(&clipboard->selection_listener.link);
> +
> + free(clipboard);
> +}
> +
> struct clipboard *
> clipboard_create(struct weston_seat *seat)
> {
> @@ -255,9 +266,12 @@ clipboard_create(struct weston_seat *seat)
>
> clipboard->seat = seat;
> clipboard->selection_listener.notify = clipboard_set_selection;
> + clipboard->destroy_listener.notify = clipboard_destroy;
>
> wl_signal_add(&seat->seat.selection_signal,
> &clipboard->selection_listener);
> + wl_signal_add(&seat->seat.destroy_signal,
> + &clipboard->destroy_listener);
>
> return clipboard;
> }
> --
> 1.7.11.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list