Commit 330fc86d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

xdg-shell: bind wl_shm

This will be needed to allocate a cursor.
parent 0f1aabbb
...@@ -71,6 +71,7 @@ struct vout_window_sys_t ...@@ -71,6 +71,7 @@ struct vout_window_sys_t
{ {
struct wl_registry *registry; struct wl_registry *registry;
struct wl_compositor *compositor; struct wl_compositor *compositor;
struct wl_shm *shm;
struct xdg_wm_base *wm_base; struct xdg_wm_base *wm_base;
struct xdg_surface *surface; struct xdg_surface *surface;
struct xdg_toplevel *toplevel; struct xdg_toplevel *toplevel;
...@@ -355,6 +356,9 @@ static void registry_global_cb(void *data, struct wl_registry *registry, ...@@ -355,6 +356,9 @@ static void registry_global_cb(void *data, struct wl_registry *registry,
1); 1);
#endif #endif
else else
if (!strcmp(iface, "wl_shm"))
sys->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
else
if (!strcmp(iface, "wl_seat")) if (!strcmp(iface, "wl_seat"))
seat_create(wnd, registry, name, vers, &sys->seats); seat_create(wnd, registry, name, vers, &sys->seats);
else else
...@@ -398,6 +402,7 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg) ...@@ -398,6 +402,7 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
return VLC_ENOMEM; return VLC_ENOMEM;
sys->compositor = NULL; sys->compositor = NULL;
sys->shm = NULL;
sys->wm_base = NULL; sys->wm_base = NULL;
sys->surface = NULL; sys->surface = NULL;
sys->toplevel = NULL; sys->toplevel = NULL;
...@@ -536,6 +541,8 @@ error: ...@@ -536,6 +541,8 @@ error:
xdg_wm_base_destroy(sys->wm_base); xdg_wm_base_destroy(sys->wm_base);
if (wnd->handle.wl != NULL) if (wnd->handle.wl != NULL)
wl_surface_destroy(wnd->handle.wl); wl_surface_destroy(wnd->handle.wl);
if (sys->shm != NULL)
wl_shm_destroy(sys->shm);
if (sys->compositor != NULL) if (sys->compositor != NULL)
wl_compositor_destroy(sys->compositor); wl_compositor_destroy(sys->compositor);
if (sys->registry != NULL) if (sys->registry != NULL)
...@@ -565,6 +572,8 @@ static void Close(vout_window_t *wnd) ...@@ -565,6 +572,8 @@ static void Close(vout_window_t *wnd)
xdg_surface_destroy(sys->surface); xdg_surface_destroy(sys->surface);
xdg_wm_base_destroy(sys->wm_base); xdg_wm_base_destroy(sys->wm_base);
wl_surface_destroy(wnd->handle.wl); wl_surface_destroy(wnd->handle.wl);
if (sys->shm != NULL)
wl_shm_destroy(sys->shm);
wl_compositor_destroy(sys->compositor); wl_compositor_destroy(sys->compositor);
wl_registry_destroy(sys->registry); wl_registry_destroy(sys->registry);
wl_display_disconnect(wnd->display.wl); wl_display_disconnect(wnd->display.wl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment