Skip to content
Snippets Groups Projects
Commit 14856e8b authored by Emmanuel Gil Peyrot's avatar Emmanuel Gil Peyrot
Browse files

Wayland: Bind, listen and destroy xdg_wm_base

parent 73567ae5
No related branches found
No related tags found
No related merge requests found
......@@ -470,6 +470,17 @@ static const struct wl_seat_listener seatListener = {
seatHandleCapabilities
};
static void wmBaseHandlePing(void* data,
struct xdg_wm_base* wmBase,
uint32_t serial)
{
xdg_wm_base_pong(wmBase, serial);
}
static const struct xdg_wm_base_listener wmBaseListener = {
wmBaseHandlePing
};
static void registryHandleGlobal(void* data,
struct wl_registry* registry,
uint32_t name,
......@@ -506,6 +517,12 @@ static void registryHandleGlobal(void* data,
wl_seat_add_listener(_glfw.wl.seat, &seatListener, NULL);
}
}
else if (strcmp(interface, "xdg_wm_base") == 0)
{
_glfw.wl.wmBase =
wl_registry_bind(registry, name, &xdg_wm_base_interface, 1);
xdg_wm_base_add_listener(_glfw.wl.wmBase, &wmBaseListener, NULL);
}
else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0)
{
_glfw.wl.relativePointerManager =
......@@ -851,6 +868,8 @@ void _glfwPlatformTerminate(void)
wl_shm_destroy(_glfw.wl.shm);
if (_glfw.wl.shell)
wl_shell_destroy(_glfw.wl.shell);
if (_glfw.wl.wmBase)
xdg_wm_base_destroy(_glfw.wl.wmBase);
if (_glfw.wl.pointer)
wl_pointer_destroy(_glfw.wl.pointer);
if (_glfw.wl.keyboard)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment