static void display_add_seat(struct wayland_compositor *c, uint32_t id) { struct wayland_input *input; input = malloc(sizeof *input); if (input == NULL) return; memset(input, 0, sizeof *input); weston_seat_init(&input->base, &c->base, "default"); input->compositor = c; input->seat = wl_registry_bind(c->parent.registry, id, &wl_seat_interface, 1); wl_list_insert(c->input_list.prev, &input->link); wl_seat_add_listener(input->seat, &seat_listener, input); wl_seat_set_user_data(input->seat, input); }
void Wayland_display_add_input(SDL_VideoData *d, uint32_t id) { struct SDL_WaylandInput *input; input = SDL_calloc(1, sizeof *input); if (input == NULL) return; input->display = d; input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, 1); input->sx_w = wl_fixed_from_int(0); input->sy_w = wl_fixed_from_int(0); d->input = input; wl_seat_add_listener(input->seat, &seat_listener, input); wl_seat_set_user_data(input->seat, input); WAYLAND_wl_display_flush(d->display); }
static struct ss_seat * ss_seat_create(struct shared_output *so, uint32_t id) { struct ss_seat *seat; seat = zalloc(sizeof *seat); if (seat == NULL) return NULL; weston_seat_init(&seat->base, so->output->compositor, "default"); seat->output = so; seat->parent.seat = wl_registry_bind(so->parent.registry, id, &wl_seat_interface, 1); wl_list_insert(so->seat_list.prev, &seat->link); wl_seat_add_listener(seat->parent.seat, &ss_seat_listener, seat); wl_seat_set_user_data(seat->parent.seat, seat); return seat; }
/* local functions */ void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id) { Ecore_Wl_Input *input; LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!(input = malloc(sizeof(Ecore_Wl_Input)))) return; memset(input, 0, sizeof(Ecore_Wl_Input)); input->display = ewd; input->pointer_focus = NULL; input->keyboard_focus = NULL; input->touch_focus = NULL; input->seat = wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1); ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input)); wl_seat_add_listener(input->seat, &_ecore_wl_seat_listener, input); wl_seat_set_user_data(input->seat, input); wl_array_init(&input->data_types); if (ewd->wl.data_device_manager) { input->data_device = wl_data_device_manager_get_data_device(ewd->wl.data_device_manager, input->seat); wl_data_device_add_listener(input->data_device, &_ecore_wl_data_listener, input); } ewd->input = input; }
void XdevLWindowEventServerWayland::setSeat() { wl_seat_add_listener(m_seat, &seatListener, windowEventServer); wl_seat_set_user_data(m_seat, windowEventServer); }