diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-12-11 11:00:39 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-12-12 10:37:30 -0500 |
commit | 2f3c6cccf5d6b2d6ffd3cee62e7b624dc80dc6e6 (patch) | |
tree | 69d3367cf7dbd7f756d45d89cd37e6016503a88d /sway/config/seat.c | |
parent | f645f8efd688104cdeac01cd940b32a8ff978571 (diff) |
Add seat <seat> idle_{inhibit,wake} <sources...>
This adds seat configuration options which can be used to configure what
events affect the idle behavior of sway.
An example use-case is mobile devices: you would remove touch from the
list of idle_wake events. This allows the phone to stay on while you're
actively using it, but doesn't wake from idle on touch events while it's
sleeping in your pocket.
Diffstat (limited to 'sway/config/seat.c')
-rw-r--r-- | sway/config/seat.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/config/seat.c b/sway/config/seat.c index d2401162..6c916727 100644 --- a/sway/config/seat.c +++ b/sway/config/seat.c @@ -1,4 +1,5 @@ #define _POSIX_C_SOURCE 200809L +#include <limits.h> #include <stdlib.h> #include <string.h> #include "sway/config.h" @@ -17,6 +18,8 @@ struct seat_config *new_seat_config(const char* name) { return NULL; } + seat->idle_inhibit_sources = seat->idle_wake_sources = UINT32_MAX; + seat->fallback = -1; seat->attachments = create_list(); if (!sway_assert(seat->attachments, @@ -160,6 +163,14 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) { dest->xcursor_theme.name = strdup(source->xcursor_theme.name); dest->xcursor_theme.size = source->xcursor_theme.size; } + + if (source->idle_inhibit_sources != UINT32_MAX) { + dest->idle_inhibit_sources = source->idle_inhibit_sources; + } + + if (source->idle_wake_sources != UINT32_MAX) { + dest->idle_wake_sources = source->idle_wake_sources; + } } struct seat_config *copy_seat_config(struct seat_config *seat) { |