libweston/input: Remove redundant surface destroy listener in constraints

Currently, the surface destroy listener in pointer constraints is redundant,
since surface destruction already handles pointer constraints destruction (see
libweston/compositor.c:weston_surface_unref()).

Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
(cherry picked from commit 64da736d37a7df8b3bd6fd43746ac513bae72748)
dev
Sergio Gómez 2 years ago committed by Marius Vlad
parent ff13a90eea
commit 0bd68d9ad6
  1. 1
      include/libweston/libweston.h
  2. 17
      libweston/input.c

@ -1605,7 +1605,6 @@ struct weston_pointer_constraint {
bool hint_is_pending;
struct wl_listener pointer_destroy_listener;
struct wl_listener surface_destroy_listener;
struct wl_listener surface_commit_listener;
struct wl_listener surface_activate_listener;
};

@ -3713,8 +3713,6 @@ enable_pointer_constraint(struct weston_pointer_constraint *constraint,
constraint->view = view;
pointer_constraint_notify_activated(constraint);
weston_pointer_start_grab(constraint->pointer, &constraint->grab);
wl_list_remove(&constraint->surface_destroy_listener.link);
wl_list_init(&constraint->surface_destroy_listener.link);
}
static bool
@ -3738,7 +3736,6 @@ weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint)
weston_pointer_constraint_disable(constraint);
wl_list_remove(&constraint->pointer_destroy_listener.link);
wl_list_remove(&constraint->surface_destroy_listener.link);
wl_list_remove(&constraint->surface_commit_listener.link);
wl_list_remove(&constraint->surface_activate_listener.link);
@ -3934,16 +3931,6 @@ pointer_constraint_pointer_destroyed(struct wl_listener *listener, void *data)
weston_pointer_constraint_destroy(constraint);
}
static void
pointer_constraint_surface_destroyed(struct wl_listener *listener, void *data)
{
struct weston_pointer_constraint *constraint =
container_of(listener, struct weston_pointer_constraint,
surface_destroy_listener);
weston_pointer_constraint_destroy(constraint);
}
static void
pointer_constraint_surface_committed(struct wl_listener *listener, void *data)
{
@ -4005,8 +3992,6 @@ weston_pointer_constraint_create(struct weston_surface *surface,
constraint->surface_activate_listener.notify =
pointer_constraint_surface_activate;
constraint->surface_destroy_listener.notify =
pointer_constraint_surface_destroyed;
constraint->surface_commit_listener.notify =
pointer_constraint_surface_committed;
constraint->pointer_destroy_listener.notify =
@ -4016,8 +4001,6 @@ weston_pointer_constraint_create(struct weston_surface *surface,
&constraint->surface_activate_listener);
wl_signal_add(&pointer->destroy_signal,
&constraint->pointer_destroy_listener);
wl_signal_add(&surface->destroy_signal,
&constraint->surface_destroy_listener);
wl_signal_add(&surface->commit_signal,
&constraint->surface_commit_listener);

Loading…
Cancel
Save