[RFC wayland] protocol: Send the interface name when removing globals

Pekka Paalanen ppaalanen at gmail.com
Thu Feb 14 05:41:49 PST 2013


On Thu, 14 Feb 2013 13:16:45 +0000
Rob Bradford <robert.bradford at intel.com> wrote:

> From: Rob Bradford <rob at linux.intel.com>
> 
> This allows a client to figure out the type of the object that has been
> removed from the registry. In particular this allows the client to
> differentiate between output devices and seats being removed.

Hi Rob,

doesn't the client already know the object type from the
wl_registry.global event it got in the first place?

The name argument in wl_registry.global_remove is the same as in
wl_registry.global. Don't you need to keep a list of available globals
anyway?


Thanks,
pq

> ---
>  protocol/wayland.xml | 3 ++-
>  src/wayland-server.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/protocol/wayland.xml b/protocol/wayland.xml
> index 0ce68ef..8a2be68 100644
> --- a/protocol/wayland.xml
> +++ b/protocol/wayland.xml
> @@ -92,7 +92,7 @@
>      </event>
>    </interface>
>  
> -  <interface name="wl_registry" version="1">
> +  <interface name="wl_registry" version="2">
>      <description summary="global registry object">
>        The global registry object.  The server has a number of global
>        objects that are available to all clients.  These objects
> @@ -144,6 +144,7 @@
>  	the global going away and a client sending a request to it.
>        </description>
>        <arg name="name" type="uint"/>
> +      <arg name="interface" type="string"/>
>      </event>
>    </interface>
>  
> diff --git a/src/wayland-server.c b/src/wayland-server.c
> index dae7177..cc8d28c 100644
> --- a/src/wayland-server.c
> +++ b/src/wayland-server.c
> @@ -1172,7 +1172,8 @@ wl_display_remove_global(struct wl_display *display, struct wl_global *global)
>  
>  	wl_list_for_each(resource, &display->registry_resource_list, link)
>  		wl_resource_post_event(resource, WL_REGISTRY_GLOBAL_REMOVE,
> -				       global->name);
> +				       global->name,
> +				       global->interface->name);
>  	wl_list_remove(&global->link);
>  	free(global);
>  }



More information about the wayland-devel mailing list