<div>Hi,<br></div><div><br></div><div>Excuse me if this is something that is already explained in the protocols, but I couldn't find the solution by myown.<br></div><div><br></div><div>I'm working on a client-side library, and I need to keep track of wl (or xdg in the future) outputs. My first idea was:<br></div><div>- Have a `wl_list` in my context<br></div><div>- In the global listener, add the `wl_output` to the list<br></div><div>- In the global remove listener, remove the `wl_output` from the list<br></div><div><br></div><div> However, in the global remove listener, we only have a "uint32_t id" parameter. How am I supposed to know that the type of the object being removed is a `wl_output`? In the global listener we at least have a "const char *interface" that let us know that.</div><div><br></div><div>This is what I have (some parts omitted for brevity):<br></div><div><br></div><div>```<br></div><div>static void wl_registry_listener_global(void *data, struct wl_registry *registry,uint32_t name, const char *interface, uint32_t version)<br></div><div>{<br></div><div>    struct mycontext *mycontext = data;<br></div><div>    if (!strcmp(interface, "wl_output")) {<br></div><div>        struct wl_output *output = wl_registry_bind(registry, name, &wl_output_interface, 1);</div><div>        wl_output_add_listener(output, &wl_output_listener, mycontext);<br></div><div>        wl_list_insert(&mycontext->outputs, output);</div><div>    }<br></div><div>}<br></div><div><br></div><div>static void wl_registry_listener_global_remove(void *data, struct wl_registry *registry, uint32_t id)<br></div><div>{<br></div><div>    struct mycontext *mycontext = data;<br></div><div>    if (...) {<br></div><div>        wl_list_remove(&mycontext->outputs, output);<br></div><div>    }</div><div>}<br></div><div>```<br></div><div><br></div><div>Thanks in advance,<br></div><div>- Felipe</div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div><div class="protonmail_signature_block-proton">Sent with <a href="https://protonmail.com" target="_blank">ProtonMail</a> Secure Email.<br></div></div><div><br></div>