Re: [PATCH wayland 2/2] server: Send differentiated errors on wl_registry.bind

2018-01-22 Thread Pekka Paalanen
On Mon, 22 Jan 2018 13:32:31 +0100
Philipp Kerling  wrote:

> This now uses the new error codes introduced to wl_registry instead
> of abusing WL_DISPLAY_ERROR_INVALID_OBJECT.
> ---
>  src/wayland-server.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Hi,

both patches are:

Acked-by: Pekka Paalanen 

I wonder if anyone has anything against changing the error values for
the two cases. WL_DISPLAY_ERROR_INVALID_OBJECT has the same value as
WL_REGISTRY_ERROR_INVALID_GLOBAL, but the others do not.


Thanks,
pq


pgpNoJ8W9pdZw.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH wayland 2/2] server: Send differentiated errors on wl_registry.bind

2018-01-22 Thread Philipp Kerling
This now uses the new error codes introduced to wl_registry instead
of abusing WL_DISPLAY_ERROR_INVALID_OBJECT.
---
 src/wayland-server.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/wayland-server.c b/src/wayland-server.c
index 7225b4e..e33af62 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -882,21 +882,21 @@ registry_bind(struct wl_client *client,
 
if (>link == >global_list)
wl_resource_post_error(resource,
-  WL_DISPLAY_ERROR_INVALID_OBJECT,
+  WL_REGISTRY_ERROR_INVALID_GLOBAL,
   "invalid global %s (%d)", interface, 
name);
else if (version == 0)
wl_resource_post_error(resource,
-  WL_DISPLAY_ERROR_INVALID_OBJECT,
+  WL_REGISTRY_ERROR_INVALID_VERSION,
   "invalid version for global %s (%d): 0 
is not a valid version",
   interface, name);
else if (global->version < version)
wl_resource_post_error(resource,
-  WL_DISPLAY_ERROR_INVALID_OBJECT,
+  WL_REGISTRY_ERROR_INCOMPATIBLE_VERSION,
   "invalid version for global %s (%d): 
have %d, wanted %d",
   interface, name, global->version, 
version);
else if (!wl_global_is_visible(client, global))
wl_resource_post_error(resource,
-  WL_DISPLAY_ERROR_INVALID_OBJECT,
+  WL_REGISTRY_ERROR_INVALID_GLOBAL,
   "invalid global %s (%d)", interface, 
name);
else
global->bind(client, global->data, version, id);
-- 
2.15.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel