mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
types/wlr_virtual_pointer_v1: fix wlr_pointer destroy sequence
This commit is contained in:
parent
cdb3e80b39
commit
c84744321e
1 changed files with 10 additions and 9 deletions
|
@ -9,13 +9,7 @@
|
||||||
#include "wlr-virtual-pointer-unstable-v1-protocol.h"
|
#include "wlr-virtual-pointer-unstable-v1-protocol.h"
|
||||||
|
|
||||||
static void pointer_destroy(struct wlr_pointer *pointer) {
|
static void pointer_destroy(struct wlr_pointer *pointer) {
|
||||||
struct wlr_virtual_pointer_v1 *virtual_pointer =
|
/* no-op, pointer belongs to the wlr_virtual_pointer_v1 */
|
||||||
(struct wlr_virtual_pointer_v1 *)pointer;
|
|
||||||
|
|
||||||
wl_resource_set_user_data(virtual_pointer->resource, NULL);
|
|
||||||
wlr_signal_emit_safe(&virtual_pointer->events.destroy, virtual_pointer);
|
|
||||||
wl_list_remove(&virtual_pointer->link);
|
|
||||||
free(virtual_pointer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wlr_pointer_impl pointer_impl = {
|
static const struct wlr_pointer_impl pointer_impl = {
|
||||||
|
@ -205,9 +199,16 @@ static void virtual_pointer_axis_discrete(struct wl_client *client,
|
||||||
static void virtual_pointer_destroy_resource(struct wl_resource *resource) {
|
static void virtual_pointer_destroy_resource(struct wl_resource *resource) {
|
||||||
struct wlr_virtual_pointer_v1 *pointer =
|
struct wlr_virtual_pointer_v1 *pointer =
|
||||||
virtual_pointer_from_resource(resource);
|
virtual_pointer_from_resource(resource);
|
||||||
if (pointer != NULL) {
|
if (pointer == NULL) {
|
||||||
wlr_pointer_destroy(&pointer->pointer);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: rework wlr_pointer device destruction */
|
||||||
|
wlr_signal_emit_safe(&pointer->events.destroy, pointer);
|
||||||
|
wlr_pointer_destroy(&pointer->pointer);
|
||||||
|
wl_resource_set_user_data(pointer->resource, NULL);
|
||||||
|
wl_list_remove(&pointer->link);
|
||||||
|
free(pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtual_pointer_destroy(struct wl_client *client,
|
static void virtual_pointer_destroy(struct wl_client *client,
|
||||||
|
|
Loading…
Reference in a new issue