ecore-wl2: Only bind one shell

Since we only ever use One shell at a time, let's not bind all of them
as that is useless.

ref T5226

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-02-28 08:40:26 -05:00
parent 86fe6609c2
commit 0e93f03636
1 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@
static Eina_Hash *_server_displays = NULL;
static Eina_Hash *_client_displays = NULL;
static Eina_Bool _shell_bound = EINA_FALSE;
static Eina_Bool _cb_connect_idle(void *data);
static Eina_Bool _cb_connect_data(void *data, Ecore_Fd_Handler *hdl);
@ -152,12 +153,13 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
ewd->wl.data_device_manager =
wl_registry_bind(registry, id, &wl_data_device_manager_interface, ewd->wl.data_device_manager_version);
}
else if (!strcmp(interface, "wl_shell"))
else if ((!strcmp(interface, "wl_shell")) && (!_shell_bound))
{
ewd->wl.wl_shell =
wl_registry_bind(registry, id, &wl_shell_interface, 1);
_shell_bound = EINA_TRUE;
}
else if ((!strcmp(interface, "xdg_shell")) &&
else if (((!strcmp(interface, "xdg_shell")) && (!_shell_bound)) &&
(!getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")))
{
Ecore_Wl2_Window *window;
@ -168,6 +170,8 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
XDG_V5_UNSTABLE_VERSION);
xdg_shell_add_listener(ewd->wl.xdg_shell, &_xdg_shell_listener, NULL);
_shell_bound = EINA_TRUE;
EINA_INLIST_FOREACH(ewd->windows, window)
if ((window->type != ECORE_WL2_WINDOW_TYPE_DND) &&
(window->type != ECORE_WL2_WINDOW_TYPE_NONE))
@ -175,12 +179,13 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
else
window->pending.configure = EINA_FALSE;
}
else if (!strcmp(interface, "zxdg_shell_v6"))
else if ((!strcmp(interface, "zxdg_shell_v6")) && (!_shell_bound))
{
ewd->wl.zxdg_shell =
wl_registry_bind(registry, id, &zxdg_shell_v6_interface, 1);
zxdg_shell_v6_add_listener(ewd->wl.zxdg_shell,
&_zxdg_shell_listener, NULL);
_shell_bound = EINA_TRUE;
}
else if ((eina_streq(interface, "www")) &&
(getenv("EFL_WAYLAND_ENABLE_WWW")))