weston-pointer: Add destroy signal

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Jonas Ådahl 8 years ago
parent f7deb6a959
commit 3eb4ddd24d
  1. 1
      libweston/compositor.h
  2. 3
      libweston/input.c

@ -370,6 +370,7 @@ struct weston_pointer {
struct wl_listener focus_resource_listener;
struct wl_signal focus_signal;
struct wl_signal motion_signal;
struct wl_signal destroy_signal;
struct weston_view *sprite;
struct wl_listener sprite_destroy_listener;

@ -796,6 +796,7 @@ weston_pointer_create(struct weston_seat *seat)
wl_signal_init(&pointer->motion_signal);
wl_signal_init(&pointer->focus_signal);
wl_list_init(&pointer->focus_view_listener.link);
wl_signal_init(&pointer->destroy_signal);
pointer->sprite_destroy_listener.notify = pointer_handle_sprite_destroy;
@ -817,6 +818,8 @@ weston_pointer_create(struct weston_seat *seat)
WL_EXPORT void
weston_pointer_destroy(struct weston_pointer *pointer)
{
wl_signal_emit(&pointer->destroy_signal, pointer);
if (pointer->sprite)
pointer_unmap_sprite(pointer);

Loading…
Cancel
Save