diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-12-04 20:21:15 +0100 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-12-04 20:29:16 +0100 |
commit | 6e34b0ec1f50612cb2767da3dbc27be0be63041d (patch) | |
tree | 09ddcae76bdfc656f6a80f84bd9b3b2b900b460b /video/out/wayland_common.c | |
parent | bf90317ad14dde82f16a0f0f3d2561d38ac970ff (diff) | |
download | mpv-6e34b0ec1f50612cb2767da3dbc27be0be63041d.tar.bz2 mpv-6e34b0ec1f50612cb2767da3dbc27be0be63041d.tar.xz |
wayland: print waylands display erros
This is very usefull especially if you want to use newer wayland stuff like
wl_subsurfaces and xdg_surfaces.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 8a89964514..e18e22c7af 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -111,6 +111,44 @@ static const struct mp_keymap keymap[] = { /** Wayland listeners **/ + +static void display_handle_error(void *data, + struct wl_display *display, + void *object_id, + uint32_t code, + const char *message) +{ + struct vo_wayland_state *wl = data; + const char * error_type_msg = ""; + + switch (code) { + case WL_DISPLAY_ERROR_INVALID_OBJECT: + error_type_msg = "Invalid object"; + break; + case WL_DISPLAY_ERROR_INVALID_METHOD: + error_type_msg = "Invalid method"; + break; + case WL_DISPLAY_ERROR_NO_MEMORY: + error_type_msg = "No memory"; + break; + } + + MP_ERR(wl, "%s: %s\n", error_type_msg, message); +} + +static void display_handle_delete_id(void *data, + struct wl_display *display, + uint32_t id) +{ + struct vo_wayland_state *wl = data; + MP_DBG(wl, "Object %u deleted\n", id); +} + +const struct wl_display_listener display_listener = { + display_handle_error, + display_handle_delete_id +}; + static void ssurface_handle_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial) @@ -606,6 +644,8 @@ static bool create_display (struct vo_wayland_state *wl) return false; } + wl_display_add_listener(wl->display.display, &display_listener, wl); + wl_list_init(&wl->display.output_list); wl->display.registry = wl_display_get_registry(wl->display.display); wl_registry_add_listener(wl->display.registry, ®istry_listener, wl); |