From 3a949ea8eb0277f52d10ef0d54760323752321c9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 4 Oct 2022 11:31:23 +0200 Subject: idle-notify-v1: new protocol implementation References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29 --- include/wlr/types/wlr_idle_notify_v1.h | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 include/wlr/types/wlr_idle_notify_v1.h (limited to 'include') 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 + +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 -- cgit v1.2.3