diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 4a166ef65..997b90f53 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -586,11 +586,21 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); wl_array_init(&xwl_seat->keys); + + xorg_list_init(&xwl_seat->touches); } void xwl_seat_destroy(struct xwl_seat *xwl_seat) { + struct xwl_touch *xwl_touch, *next_xwl_touch; + + xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, + &xwl_seat->touches, link_touch) { + xorg_list_del(&xwl_touch->link_touch); + free(xwl_touch); + } + wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); if (xwl_seat->cursor_frame_cb) diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index cd728ca33..3c10862e0 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -106,6 +106,13 @@ struct xwl_window { #define MODIFIER_META 0x01 +struct xwl_touch { + struct xwl_window *window; + int32_t id; + int x, y; + struct xorg_list link_touch; +}; + struct xwl_seat { DeviceIntPtr pointer; DeviceIntPtr keyboard; @@ -123,6 +130,8 @@ struct xwl_seat { struct wl_callback *cursor_frame_cb; Bool cursor_needs_update; + struct xorg_list touches; + size_t keymap_size; char *keymap; struct wl_surface *keyboard_focus;