aboutsummaryrefslogtreecommitdiffstats
path: root/src/wayland-server.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-05-12 19:01:26 +0200
committerSimon Ser <contact@emersion.fr>2022-05-23 08:53:19 +0000
commitd01868413ff12b09729a07b0f1ccef2adb40361a (patch)
tree8cd07c8c7a8790fc24537620068f5c961c438508 /src/wayland-server.c
parentutil: Limit size of wl_map (diff)
downloadwayland-d01868413ff12b09729a07b0f1ccef2adb40361a.tar
wayland-d01868413ff12b09729a07b0f1ccef2adb40361a.tar.gz
wayland-d01868413ff12b09729a07b0f1ccef2adb40361a.tar.bz2
wayland-d01868413ff12b09729a07b0f1ccef2adb40361a.tar.lz
wayland-d01868413ff12b09729a07b0f1ccef2adb40361a.tar.xz
wayland-d01868413ff12b09729a07b0f1ccef2adb40361a.tar.zst
wayland-d01868413ff12b09729a07b0f1ccef2adb40361a.zip
server: add wl_global_get_version
Add a helper to check the advertised version of a global. This can be handy when checking whether a compositor feature is supported, instead of having to store the version passed to wl_global_create separately. Signed-off-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'src/wayland-server.c')
-rw-r--r--src/wayland-server.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c
index 71b0360..93e42c7 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -1315,6 +1315,20 @@ wl_global_get_interface(const struct wl_global *global)
return global->interface;
}
+/** Get the version of the given global.
+ *
+ * \param global The global object.
+ * \return The version advertised by the global.
+ *
+ * \memberof wl_global
+ * \since 1.21
+ */
+WL_EXPORT uint32_t
+wl_global_get_version(const struct wl_global *global)
+{
+ return global->version;
+}
+
/** Get the display object for the given global
*
* \param global The global object