Update wayland-client support for recent Wayland api changes (replace

wl_display_add_global with wl_global_create, and fix wl_client calls
to create resources with wl_resource).

NB: This brings client support up to par with version 1.2 of Wayland

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-15 13:40:32 +01:00
parent 8e72f22d5d
commit 2b6a8ecf24
2 changed files with 11 additions and 13 deletions

View File

@ -232,8 +232,8 @@ e_comp_wl_init(void)
wl_signal_init(&_e_wl_comp->signals.seat);
/* try to add compositor to the displays globals */
if (!wl_display_add_global(_e_wl_comp->wl.display, &wl_compositor_interface,
_e_wl_comp, _e_comp_wl_cb_bind))
if (!wl_global_create(_e_wl_comp->wl.display, &wl_compositor_interface, 3,
_e_wl_comp, _e_comp_wl_cb_bind))
{
ERR("Could not add compositor to globals: %m");
goto err;
@ -745,9 +745,8 @@ wl_data_device_set_keyboard_focus(struct wl_seat *seat)
EAPI int
wl_data_device_manager_init(struct wl_display *display)
{
if (wl_display_add_global(display,
&wl_data_device_manager_interface,
NULL, _bind_manager) == NULL)
if (!wl_global_create(display, &wl_data_device_manager_interface, 1,
NULL, _bind_manager))
return -1;
return 0;
}
@ -1730,8 +1729,8 @@ _e_comp_wl_input_init(void)
wl_seat_init(&_e_wl_comp->input->wl.seat);
/* try to add this input to the diplay's list of globals */
if (!wl_display_add_global(_e_wl_comp->wl.display, &wl_seat_interface,
_e_wl_comp->input, _e_comp_wl_input_cb_bind))
if (!wl_global_create(_e_wl_comp->wl.display, &wl_seat_interface, 2,
_e_wl_comp->input, _e_comp_wl_input_cb_bind))
{
ERR("Could not add Input to Wayland Display Globals: %m");
goto err;

View File

@ -182,14 +182,13 @@ e_modapi_init(E_Module *m)
_e_wl_shell_shell_surface_create;
/* try to add this shell to the display's global list */
if (!(gshell =
wl_display_add_global(_e_wl_comp->wl.display, &wl_shell_interface,
shell, _e_wl_shell_cb_bind)))
if (!(gshell = wl_global_create(_e_wl_comp->wl.display, &wl_shell_interface,
1, shell, _e_wl_shell_cb_bind)))
goto err;
/* try to add the desktop shell interface to the display's global list */
if (!wl_display_add_global(_e_wl_comp->wl.display,
&e_desktop_shell_interface, shell, NULL))
if (!wl_global_create(_e_wl_comp->wl.display, &e_desktop_shell_interface,
2, shell, NULL))
goto err;
/* for each input, we need to create a pointer focus listener */
@ -214,7 +213,7 @@ e_modapi_init(E_Module *m)
err:
/* remove previously added shell global */
if (gshell) wl_display_remove_global(_e_wl_comp->wl.display, gshell);
if (gshell) wl_global_destroy(gshell);
/* reset compositor shell interface */
_e_wl_comp->shell_interface.shell = NULL;