diff options
author | Simon Ser <contact@emersion.fr> | 2023-06-15 15:14:35 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-06-20 20:14:49 +0000 |
commit | 1e68e1f661e3e9a03ce306ed1e03976942444e96 (patch) | |
tree | 5c3bca310936bd5504dea676370230f574bcdf85 | |
parent | c4d4409deb50b23eec120da776de46ef8440879f (diff) |
seat: fix keyboard/pointer/touch resource destroy
We need to always unlink the resource, even if it's already inert.
seat_client_destroy_*() may be called multiple times on the same
resource.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3638
-rw-r--r-- | types/seat/wlr_seat_keyboard.c | 5 | ||||
-rw-r--r-- | types/seat/wlr_seat_pointer.c | 5 | ||||
-rw-r--r-- | types/seat/wlr_seat_touch.c | 5 |
3 files changed, 0 insertions, 15 deletions
diff --git a/types/seat/wlr_seat_keyboard.c b/types/seat/wlr_seat_keyboard.c index 1dab1b32..0193d58d 100644 --- a/types/seat/wlr_seat_keyboard.c +++ b/types/seat/wlr_seat_keyboard.c @@ -473,11 +473,6 @@ void seat_client_create_inert_keyboard(struct wl_client *client, } void seat_client_destroy_keyboard(struct wl_resource *resource) { - struct wlr_seat_client *seat_client = - seat_client_from_keyboard_resource(resource); - if (seat_client == NULL) { - return; - } wl_list_remove(wl_resource_get_link(resource)); wl_list_init(wl_resource_get_link(resource)); wl_resource_set_user_data(resource, NULL); diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c index 5d623dbc..830a885e 100644 --- a/types/seat/wlr_seat_pointer.c +++ b/types/seat/wlr_seat_pointer.c @@ -553,11 +553,6 @@ void seat_client_create_inert_pointer(struct wl_client *client, } void seat_client_destroy_pointer(struct wl_resource *resource) { - struct wlr_seat_client *seat_client = - wlr_seat_client_from_pointer_resource(resource); - if (seat_client == NULL) { - return; - } wl_list_remove(wl_resource_get_link(resource)); wl_list_init(wl_resource_get_link(resource)); wl_resource_set_user_data(resource, NULL); diff --git a/types/seat/wlr_seat_touch.c b/types/seat/wlr_seat_touch.c index 764b58e5..4eb52ed6 100644 --- a/types/seat/wlr_seat_touch.c +++ b/types/seat/wlr_seat_touch.c @@ -454,11 +454,6 @@ void seat_client_create_inert_touch(struct wl_client *client, uint32_t version, } void seat_client_destroy_touch(struct wl_resource *resource) { - struct wlr_seat_client *seat_client = - seat_client_from_touch_resource(resource); - if (seat_client == NULL) { - return; - } wl_list_remove(wl_resource_get_link(resource)); wl_list_init(wl_resource_get_link(resource)); wl_resource_set_user_data(resource, NULL); |