aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2019-12-11 11:00:39 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-12-12 10:37:30 -0500
commit2f3c6cccf5d6b2d6ffd3cee62e7b624dc80dc6e6 (patch)
tree69d3367cf7dbd7f756d45d89cd37e6016503a88d /sway/config
parentFix lingering workspace with scratchpad show (diff)
downloadsway-2f3c6cccf5d6b2d6ffd3cee62e7b624dc80dc6e6.tar.gz
sway-2f3c6cccf5d6b2d6ffd3cee62e7b624dc80dc6e6.tar.zst
sway-2f3c6cccf5d6b2d6ffd3cee62e7b624dc80dc6e6.zip
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')
-rw-r--r--sway/config/seat.c11
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 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <limits.h>
2#include <stdlib.h> 3#include <stdlib.h>
3#include <string.h> 4#include <string.h>
4#include "sway/config.h" 5#include "sway/config.h"
@@ -17,6 +18,8 @@ struct seat_config *new_seat_config(const char* name) {
17 return NULL; 18 return NULL;
18 } 19 }
19 20
21 seat->idle_inhibit_sources = seat->idle_wake_sources = UINT32_MAX;
22
20 seat->fallback = -1; 23 seat->fallback = -1;
21 seat->attachments = create_list(); 24 seat->attachments = create_list();
22 if (!sway_assert(seat->attachments, 25 if (!sway_assert(seat->attachments,
@@ -160,6 +163,14 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) {
160 dest->xcursor_theme.name = strdup(source->xcursor_theme.name); 163 dest->xcursor_theme.name = strdup(source->xcursor_theme.name);
161 dest->xcursor_theme.size = source->xcursor_theme.size; 164 dest->xcursor_theme.size = source->xcursor_theme.size;
162 } 165 }
166
167 if (source->idle_inhibit_sources != UINT32_MAX) {
168 dest->idle_inhibit_sources = source->idle_inhibit_sources;
169 }
170
171 if (source->idle_wake_sources != UINT32_MAX) {
172 dest->idle_wake_sources = source->idle_wake_sources;
173 }
163} 174}
164 175
165struct seat_config *copy_seat_config(struct seat_config *seat) { 176struct seat_config *copy_seat_config(struct seat_config *seat) {