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>
This commit is contained in:
parent
ad141defcd
commit
64da736d37
@ -1635,7 +1635,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;
|
||||
};
|
||||
|
@ -3675,8 +3675,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
|
||||
@ -3700,7 +3698,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);
|
||||
|
||||
@ -3894,16 +3891,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)
|
||||
{
|
||||
@ -3968,8 +3955,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 =
|
||||
@ -3979,8 +3964,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…
Reference in New Issue
Block a user