mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
Call a new global listener for each existing global
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
parent
d8f2e5d6ab
commit
98d8256b8e
1 changed files with 5 additions and 0 deletions
|
|
@ -113,6 +113,7 @@ wl_display_add_global_listener(struct wl_display *display,
|
||||||
wl_display_global_func_t handler, void *data)
|
wl_display_global_func_t handler, void *data)
|
||||||
{
|
{
|
||||||
struct wl_global_listener *listener;
|
struct wl_global_listener *listener;
|
||||||
|
struct wl_global *global;
|
||||||
|
|
||||||
listener = malloc(sizeof *listener);
|
listener = malloc(sizeof *listener);
|
||||||
if (listener == NULL)
|
if (listener == NULL)
|
||||||
|
|
@ -122,6 +123,10 @@ wl_display_add_global_listener(struct wl_display *display,
|
||||||
listener->data = data;
|
listener->data = data;
|
||||||
wl_list_insert(display->global_listener_list.prev, &listener->link);
|
wl_list_insert(display->global_listener_list.prev, &listener->link);
|
||||||
|
|
||||||
|
wl_list_for_each(global, &display->global_list, link)
|
||||||
|
(*listener->handler)(display, global->id, global->interface,
|
||||||
|
global->version, listener->data);
|
||||||
|
|
||||||
return listener;
|
return listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue