diff options
author | Ilia Bozhinov <ammen99@gmail.com> | 2019-04-17 07:48:43 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-04-17 08:48:43 +0300 |
commit | d6615e0e844265d60e4624afa12b2bba1f967e57 (patch) | |
tree | 092e02ef570681b133174b3ba412d8c78f4bd0fb /include | |
parent | dc5d1d08ef60a603790d823de021fcd986434c60 (diff) |
idle: enable the compositors to add custom idle timeouts (#1655)
* idle: enable the compositors to add custom idle timeouts
* idle: add a private constructor which also creates the resource
* idle: move resource creation to the idle implementation callback
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_idle.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_idle.h b/include/wlr/types/wlr_idle.h index d8c81a60..da268555 100644 --- a/include/wlr/types/wlr_idle.h +++ b/include/wlr/types/wlr_idle.h @@ -46,6 +46,12 @@ struct wlr_idle_timeout { bool enabled; uint32_t timeout; // milliseconds + struct { + struct wl_signal idle; + struct wl_signal resume; + struct wl_signal destroy; + } events; + struct wl_listener input_listener; struct wl_listener seat_destroy; @@ -68,4 +74,15 @@ void wlr_idle_notify_activity(struct wlr_idle *idle, struct wlr_seat *seat); */ void wlr_idle_set_enabled(struct wlr_idle *idle, struct wlr_seat *seat, bool enabled); + +/** + * Create a new timer on the given seat. The idle event will be called after + * the given amount of milliseconds of inactivity, and the resumed event will + * be sent at the first user activty after the fired event. + */ +struct wlr_idle_timeout *wlr_idle_timeout_create(struct wlr_idle *idle, + struct wlr_seat *seat, uint32_t timeout); + +void wlr_idle_timeout_destroy(struct wlr_idle_timeout *timeout); + #endif |