xwayland: Add xwl_touch struct
This struct holds information about each individual, ongoing touchpoint. A list of these is held by the xwl_seat. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
parent
c1565f3ca6
commit
d96eccc057
|
@ -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);
|
xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor);
|
||||||
wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat);
|
wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat);
|
||||||
wl_array_init(&xwl_seat->keys);
|
wl_array_init(&xwl_seat->keys);
|
||||||
|
|
||||||
|
xorg_list_init(&xwl_seat->touches);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xwl_seat_destroy(struct xwl_seat *xwl_seat)
|
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_seat_destroy(xwl_seat->seat);
|
||||||
wl_surface_destroy(xwl_seat->cursor);
|
wl_surface_destroy(xwl_seat->cursor);
|
||||||
if (xwl_seat->cursor_frame_cb)
|
if (xwl_seat->cursor_frame_cb)
|
||||||
|
|
|
@ -106,6 +106,13 @@ struct xwl_window {
|
||||||
|
|
||||||
#define MODIFIER_META 0x01
|
#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 {
|
struct xwl_seat {
|
||||||
DeviceIntPtr pointer;
|
DeviceIntPtr pointer;
|
||||||
DeviceIntPtr keyboard;
|
DeviceIntPtr keyboard;
|
||||||
|
@ -123,6 +130,8 @@ struct xwl_seat {
|
||||||
struct wl_callback *cursor_frame_cb;
|
struct wl_callback *cursor_frame_cb;
|
||||||
Bool cursor_needs_update;
|
Bool cursor_needs_update;
|
||||||
|
|
||||||
|
struct xorg_list touches;
|
||||||
|
|
||||||
size_t keymap_size;
|
size_t keymap_size;
|
||||||
char *keymap;
|
char *keymap;
|
||||||
struct wl_surface *keyboard_focus;
|
struct wl_surface *keyboard_focus;
|
||||||
|
|
Loading…
Reference in New Issue