summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-11-12 21:44:37 -0500
committerKristian Høgsberg <krh@bitplanet.net>2013-11-19 13:26:32 -0800
commit40d057f2c90eaeffd6185078b25a0e0ff861f2a8 (patch)
treebcb8b4c80fa7c1541b27ee335701fcc04e6ca34f
parent148478323fa67c8a30481f4fd8d3c06ea9fb258e (diff)
wayland-server: Improve error messages for bad globals
A bug in Weston's toytoolkit gave me an hour of debugging headaches. Improve the error messages that we send if a client requests an invalid global, either by name or by version.
-rw-r--r--src/wayland-server.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c
index e04d2f4..80e76e1 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -701,11 +701,15 @@ registry_bind(struct wl_client *client,
if (global->name == name)
break;
- if (&global->link == &display->global_list ||
- global->version < version)
+ if (&global->link == &display->global_list)
wl_resource_post_error(resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
- "invalid global %d", name);
+ "invalid global %s (%d)", interface, name);
+ else if (global->version < version)
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "invalid version for global %s (%d): have %d, wanted %d",
+ interface, name, global->version, version);
else
global->bind(client, global->data, version, id);
}