ecore_wl2: Bind dmabuf global if available

Bind the dmabuf global so we can make use of it later.
This commit is contained in:
Derek Foreman 2016-04-08 15:17:00 -05:00 committed by Mike Blumenkrantz
parent 7514d08ae6
commit d6e5bdf428
2 changed files with 18 additions and 0 deletions

View File

@ -6,6 +6,7 @@
/* for MIN() */
#include <sys/param.h>
#include "linux-dmabuf-unstable-v1-client-protocol.h"
static Eina_Bool _fatal_error = EINA_FALSE;
static Eina_Hash *_server_displays = NULL;
@ -34,6 +35,16 @@ static const struct xdg_shell_listener _xdg_shell_listener =
_xdg_shell_cb_ping
};
static void
_dmabuf_cb_format(void *data EINA_UNUSED, struct zwp_linux_dmabuf_v1 *dmabuf EINA_UNUSED, uint32_t format EINA_UNUSED)
{
/* It would be awfully nice if this actually happened */
};
static const struct zwp_linux_dmabuf_v1_listener _dmabuf_listener = {
_dmabuf_cb_format
};
static void
_cb_global_event_free(void *data EINA_UNUSED, void *event)
{
@ -96,6 +107,12 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
ewd->wl.shm =
wl_registry_bind(registry, id, &wl_shm_interface, 1);
}
else if (!strcmp(interface, "zwp_linux_dmabuf_v1"))
{
ewd->wl.dmabuf =
wl_registry_bind(registry, id, &zwp_linux_dmabuf_v1_interface, 1);
zwp_linux_dmabuf_v1_add_listener(ewd->wl.dmabuf, &_dmabuf_listener, ewd);
}
else if (!strcmp(interface, "wl_data_device_manager"))
{
ewd->wl.data_device_manager =

View File

@ -75,6 +75,7 @@ struct _Ecore_Wl2_Display
struct wl_subcompositor *subcompositor;
struct wl_data_device_manager *data_device_manager;
struct wl_shm *shm;
struct zwp_linux_dmabuf_v1 *dmabuf;
struct wl_shell *wl_shell;
struct xdg_shell *xdg_shell;
struct www *www;