mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
types/wlr_virtual_keyboard_v1: fix wlr_keyboard destroy sequence
This commit is contained in:
parent
17a289e36e
commit
cdb3e80b39
1 changed files with 11 additions and 10 deletions
|
@ -34,14 +34,7 @@ static void keyboard_release_pressed_keys(struct wlr_keyboard *keyboard) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keyboard_destroy(struct wlr_keyboard *wlr_kb) {
|
static void keyboard_destroy(struct wlr_keyboard *wlr_kb) {
|
||||||
struct wlr_virtual_keyboard_v1 *keyboard =
|
/* no-op, keyboard belongs to the wlr_virtual_keyboard_v1 */
|
||||||
(struct wlr_virtual_keyboard_v1 *)wlr_kb;
|
|
||||||
|
|
||||||
keyboard_release_pressed_keys(&keyboard->keyboard);
|
|
||||||
wl_resource_set_user_data(keyboard->resource, NULL);
|
|
||||||
wlr_signal_emit_safe(&keyboard->events.destroy, keyboard);
|
|
||||||
wl_list_remove(&keyboard->link);
|
|
||||||
free(keyboard);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wlr_keyboard_impl keyboard_impl = {
|
static const struct wlr_keyboard_impl keyboard_impl = {
|
||||||
|
@ -138,9 +131,17 @@ static void virtual_keyboard_modifiers(struct wl_client *client,
|
||||||
static void virtual_keyboard_destroy_resource(struct wl_resource *resource) {
|
static void virtual_keyboard_destroy_resource(struct wl_resource *resource) {
|
||||||
struct wlr_virtual_keyboard_v1 *keyboard =
|
struct wlr_virtual_keyboard_v1 *keyboard =
|
||||||
virtual_keyboard_from_resource(resource);
|
virtual_keyboard_from_resource(resource);
|
||||||
if (keyboard != NULL) {
|
if (keyboard == NULL) {
|
||||||
wlr_keyboard_destroy(&keyboard->keyboard);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: rework wlr_keyboard device destruction */
|
||||||
|
keyboard_release_pressed_keys(&keyboard->keyboard);
|
||||||
|
wlr_signal_emit_safe(&keyboard->events.destroy, keyboard);
|
||||||
|
wlr_keyboard_destroy(&keyboard->keyboard);
|
||||||
|
wl_resource_set_user_data(keyboard->resource, NULL);
|
||||||
|
wl_list_remove(&keyboard->link);
|
||||||
|
free(keyboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtual_keyboard_destroy(struct wl_client *client,
|
static void virtual_keyboard_destroy(struct wl_client *client,
|
||||||
|
|
Loading…
Reference in a new issue