summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Gómez <sergio.g.delreal@gmail.com>2023-03-08 17:36:34 -0500
committerMarius Vlad <marius.vlad@collabora.com>2023-05-16 10:54:29 +0300
commit0bd68d9ad6b4e8b860e638ffb82abf2eeb2edd15 (patch)
tree777dec5929cdcf5df339a0b4676f418caa6fef2e
parentff13a90eea0e73ad96fcad4ce2e0e1d781465d06 (diff)
downloadweston-0bd68d9ad6b4e8b860e638ffb82abf2eeb2edd15.tar.gz
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)
-rw-r--r--include/libweston/libweston.h1
-rw-r--r--libweston/input.c17
2 files changed, 0 insertions, 18 deletions
diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
index 7382dd2d..eb3c487c 100644
--- a/include/libweston/libweston.h
+++ b/include/libweston/libweston.h
@@ -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;
};
diff --git a/libweston/input.c b/libweston/input.c
index 235cf023..db029580 100644
--- a/libweston/input.c
+++ b/libweston/input.c
@@ -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);
@@ -3935,16 +3932,6 @@ pointer_constraint_pointer_destroyed(struct wl_listener *listener, void *data)
}
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)
{
struct weston_pointer_constraint *constraint =
@@ -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);