diff --git a/src/wayland-server-core.h b/src/wayland-server-core.h index 64d71696..cbc70c09 100644 --- a/src/wayland-server-core.h +++ b/src/wayland-server-core.h @@ -279,6 +279,9 @@ wl_display_set_global_filter(struct wl_display *display, const struct wl_interface * wl_global_get_interface(const struct wl_global *global); +struct wl_display * +wl_global_get_display(const struct wl_global *global); + void * wl_global_get_user_data(const struct wl_global *global); diff --git a/src/wayland-server.c b/src/wayland-server.c index 0ce5daf6..0120326e 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -1277,6 +1277,20 @@ wl_global_get_interface(const struct wl_global *global) return global->interface; } +/** Get the display object for the given global + * + * \param global The global object + * \return The display object the global is associated with. + * + * \memberof wl_global + * \since 1.20 + */ +WL_EXPORT struct wl_display * +wl_global_get_display(const struct wl_global *global) +{ + return global->display; +} + WL_EXPORT void * wl_global_get_user_data(const struct wl_global *global) {