From b422f314512b7bcc69df86d7095b8667b1a91d7f Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 16 Jul 2013 10:38:47 +0100 Subject: [PATCH] Update e_input for recent Wayland 1.2 changes: - Use wl_resource_create and wl_global_add functions Signed-off-by: Chris Michael --- src/bin/e_wayland/e_input.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bin/e_wayland/e_input.c b/src/bin/e_wayland/e_input.c index c722bb25a..01cac9847 100644 --- a/src/bin/e_wayland/e_input.c +++ b/src/bin/e_wayland/e_input.c @@ -60,8 +60,8 @@ e_input_init(E_Compositor *comp, E_Input *seat, const char *name) wl_signal_init(&seat->signals.selection); wl_signal_init(&seat->signals.destroy); - wl_display_add_global(comp->wl.display, &wl_seat_interface, seat, - _e_input_cb_bind); + wl_global_create(comp->wl.display, &wl_seat_interface, 2, + seat, _e_input_cb_bind); seat->name = strdup(name); @@ -404,11 +404,10 @@ _e_input_cb_bind(struct wl_client *client, void *data, unsigned int version, uns if (!(seat = data)) return; - res = wl_client_add_object(client, &wl_seat_interface, - &_e_input_interface, id, data); - + res = wl_resource_create(client, &wl_seat_interface, MIN(version, 2), id); wl_list_insert(&seat->resources, wl_resource_get_link(res)); - wl_resource_set_destructor(res, _e_input_cb_unbind); + wl_resource_set_implementation(res, &_e_input_interface, data, + _e_input_cb_unbind); if (seat->pointer) caps |= WL_SEAT_CAPABILITY_POINTER; @@ -438,11 +437,11 @@ _e_input_cb_pointer_get(struct wl_client *client, struct wl_resource *resource, if (!(seat = wl_resource_get_user_data(resource))) return; if (!seat->pointer) return; - res = wl_client_add_object(client, &wl_pointer_interface, - &_e_pointer_interface, id, seat->pointer); - + res = wl_resource_create(client, &wl_pointer_interface, + wl_resource_get_version(resource), id); wl_list_insert(&seat->pointer->resources, wl_resource_get_link(res)); - wl_resource_set_destructor(res, _e_input_cb_unbind); + wl_resource_set_implementation(res, &_e_pointer_interface, + seat->pointer, _e_input_cb_unbind); if ((seat->pointer->focus) && (wl_resource_get_client(seat->pointer->focus->wl.resource) == client)) @@ -465,10 +464,11 @@ _e_input_cb_keyboard_get(struct wl_client *client, struct wl_resource *resource, if (!(seat = wl_resource_get_user_data(resource))) return; if (!seat->keyboard) return; - res = wl_client_add_object(client, &wl_keyboard_interface, NULL, id, seat); + res = wl_resource_create(client, &wl_keyboard_interface, + wl_resource_get_version(resource), id); wl_list_insert(&seat->keyboard->resources, wl_resource_get_link(res)); - wl_resource_set_destructor(res, _e_input_cb_unbind); + wl_resource_set_implementation(res, NULL, seat, _e_input_cb_unbind); wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, seat->kbd_info.fd, seat->kbd_info.size);