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

View File

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