aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-05-31 14:22:44 +0200
committerSimon Ser <contact@emersion.fr>2023-10-10 10:34:01 +0200
commitc58deb7a7d82298c76bd045113be5f33d58c45ec (patch)
treeafc3915d1612f396d4de2fdd1c208ab827b62680 /include
parent285645b8d79a7105ba48ce3a74a0e8b9bac76408 (diff)
security-context-v1: new protocol implementation
Co-authored-by: Puck Meerburg <puck@puckipedia.com> References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/68
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_security_context_v1.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_security_context_v1.h b/include/wlr/types/wlr_security_context_v1.h
new file mode 100644
index 00000000..3006fdfc
--- /dev/null
+++ b/include/wlr/types/wlr_security_context_v1.h
@@ -0,0 +1,48 @@
+/*
+ * This an unstable interface of wlroots. No guarantees are made regarding the
+ * future consistency of this API.
+ */
+#ifndef WLR_USE_UNSTABLE
+#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
+#endif
+
+#ifndef WLR_TYPES_WLR_SECURITY_CONTEXT_V1_H
+#define WLR_TYPES_WLR_SECURITY_CONTEXT_V1_H
+
+#include <wayland-server-core.h>
+
+/**
+ * An implementation of the security context protocol.
+ *
+ * Compositors can create this manager, setup a filter for Wayland globals via
+ * wl_display_set_global_filter(), and inside the filter query the security
+ * context state via wlr_security_context_manager_v1_lookup_client().
+ */
+struct wlr_security_context_manager_v1 {
+ struct wl_global *global;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+
+ void *data;
+
+ // private state
+
+ struct wl_list contexts; // wlr_security_context_v1.link
+
+ struct wl_listener display_destroy;
+};
+
+struct wlr_security_context_v1_state {
+ char *sandbox_engine; // may be NULL
+ char *app_id; // may be NULL
+ char *instance_id; // may be NULL
+};
+
+struct wlr_security_context_manager_v1 *wlr_security_context_manager_v1_create(
+ struct wl_display *display);
+const struct wlr_security_context_v1_state *wlr_security_context_manager_v1_lookup_client(
+ struct wlr_security_context_manager_v1 *manager, struct wl_client *client);
+
+#endif