aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-06-27 19:19:56 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-06-27 22:47:05 +0900
commitd0b902b962535fc71be03aac13b2a8b6ee3e04df (patch)
treed20612c31824beb92abce0ec2aabc0977620a9bc /include/wlr
parent159835de249acf9a87b2e75b97db6c5fab0a600b (diff)
wlr_idle: add helper to enable/disable all timers
There was no way to tell wlr_idle to stop processing input events and rearm timers all the time, such an API is required to have some form of idle inhibitor.
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_idle.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_idle.h b/include/wlr/types/wlr_idle.h
index 45f350be..aca9146c 100644
--- a/include/wlr/types/wlr_idle.h
+++ b/include/wlr/types/wlr_idle.h
@@ -17,6 +17,7 @@ struct wlr_idle {
struct wl_global *wl_global;
struct wl_list idle_timers; // wlr_idle_timeout::link
struct wl_event_loop *event_loop;
+ bool enabled;
struct wl_listener display_destroy;
struct {
@@ -33,6 +34,7 @@ struct wlr_idle_timeout {
struct wl_event_source *idle_source;
bool idle_state;
+ bool enabled;
uint32_t timeout; // milliseconds
struct wl_listener input_listener;
@@ -50,4 +52,11 @@ void wlr_idle_destroy(struct wlr_idle *idle);
* compositor when there is an user activity event on that seat.
*/
void wlr_idle_notify_activity(struct wlr_idle *idle, struct wlr_seat *seat);
+
+/**
+ * Enable or disable timers for a given idle resource by seat.
+ * Passing a NULL seat means update timers for all seats.
+ */
+void wlr_idle_set_enabled(struct wlr_idle *idle, struct wlr_seat *seat,
+ bool enabled);
#endif