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

Rob Bradford robert.bradford at intel.com
Thu Feb 14 05:16:45 PST 2013


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.
---
 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);
 }
-- 
1.8.1



More information about the wayland-devel mailing list