From 2f3c6cccf5d6b2d6ffd3cee62e7b624dc80dc6e6 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 11 Dec 2019 11:00:39 -0500 Subject: Add seat idle_{inhibit,wake} 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. --- sway/config/seat.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sway/config/seat.c') 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 #include #include #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) { -- cgit v1.2.3