aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndri Yngvason <andri@yngvason.is>2020-02-08 15:52:59 +0000
committerSimon Ser <contact@emersion.fr>2024-01-31 08:22:05 +0000
commit3a91dc1b483fbcb480c69b4dd2af1073cf69b52f (patch)
treef55e2f09d0e7215dd0d85a495508a153de6299bd /include
parent435ca39960f47d622017630b28788f4dd14be757 (diff)
Create & implement transient seat protocol
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_transient_seat_v1.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_transient_seat_v1.h b/include/wlr/types/wlr_transient_seat_v1.h
new file mode 100644
index 00000000..84d419bc
--- /dev/null
+++ b/include/wlr/types/wlr_transient_seat_v1.h
@@ -0,0 +1,63 @@
+/*
+ * 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_TRANSIENT_SEAT_V1_H
+#define WLR_TYPES_WLR_TRANSIENT_SEAT_V1_H
+
+#include <wayland-server-core.h>
+
+struct wlr_seat;
+
+struct wlr_transient_seat_v1 {
+ struct wl_resource *resource;
+ struct wlr_seat *seat;
+
+ // private state
+ struct wl_listener seat_destroy;
+};
+
+struct wlr_transient_seat_manager_v1 {
+ struct wl_global *global;
+ struct wl_listener display_destroy;
+
+ struct {
+ /**
+ * Upon receiving this signal, call
+ * wlr_transient_seat_v1_ready() to pass a newly created seat
+ * to the manager, or
+ * wlr_transient_seat_v1_deny() to deny the request to create
+ * a seat.
+ */
+ struct wl_signal create_seat; // struct wlr_transient_seat_v1
+ } events;
+};
+
+struct wlr_transient_seat_manager_v1 *wlr_transient_seat_manager_v1_create(
+ struct wl_display *display);
+
+/**
+ * To be called when the create_seat event is received.
+ *
+ * This signals that the seat was successfully added and is ready.
+ *
+ * When the transient seat is destroyed by the client, the wlr_seat will be
+ * destroyed. The wlr_seat may also be destroyed from elsewhere, in which case
+ * the transient seat will become inert.
+ */
+void wlr_transient_seat_v1_ready(struct wlr_transient_seat_v1 *seat,
+ struct wlr_seat *wlr_seat);
+
+/**
+ * To be called when the create_seat event is received.
+ *
+ * This signals that the compositor has denied the user's request to create a
+ * transient seat.
+ */
+void wlr_transient_seat_v1_deny(struct wlr_transient_seat_v1 *seat);
+
+#endif /* WLR_TYPES_WLR_TRANSIENT_SEAT_V1_H */