aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-10-04 11:31:23 +0200
committerSimon Ser <contact@emersion.fr>2022-10-14 13:36:15 +0000
commit3a949ea8eb0277f52d10ef0d54760323752321c9 (patch)
tree1c2e394e5b49781103ac8bb4d481dd141501af89 /include
parenta049d66dd7907aabdaf4724a723cd79e1fa9cda7 (diff)
idle-notify-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_idle_notify_v1.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_idle_notify_v1.h b/include/wlr/types/wlr_idle_notify_v1.h
new file mode 100644
index 00000000..7bc11cb7
--- /dev/null
+++ b/include/wlr/types/wlr_idle_notify_v1.h
@@ -0,0 +1,44 @@
+/*
+ * 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_IDLE_NOTIFY_H
+#define WLR_TYPES_WLR_IDLE_NOTIFY_H
+
+#include <wayland-server-core.h>
+
+struct wlr_seat;
+
+/**
+ * An idle notifier, implementing the ext-idle-notify-v1 protocol.
+ */
+struct wlr_idle_notifier_v1;
+
+/**
+ * Create the ext_idle_notifier_v1 global.
+ */
+struct wlr_idle_notifier_v1 *wlr_idle_notifier_v1_create(struct wl_display *display);
+
+/**
+ * Inhibit idle.
+ *
+ * Compositors should call this function when the idle state is disabled, e.g.
+ * because a visible client is using the idle-inhibit protocol.
+ */
+void wlr_idle_notifier_v1_set_inhibited(struct wlr_idle_notifier_v1 *notifier,
+ bool inhibited);
+
+/**
+ * Notify for user activity on a seat.
+ *
+ * Compositors should call this function whenever an input event is triggered
+ * on a seat.
+ */
+void wlr_idle_notifier_v1_notify_activity(struct wlr_idle_notifier_v1 *notifier,
+ struct wlr_seat *seat);
+
+#endif