aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorBenjamin Cheng <ben@bcheng.me>2019-03-25 22:05:49 -0400
committerBrian Ashworth <bosrsf04@gmail.com>2019-04-14 19:31:36 -0400
commitbd3720585e91ae0dfcc4be30149ae4f8f5218174 (patch)
tree3a44b51a2c5a78bfbde227180c3853875a2258a4 /sway/config.c
parent6737b90cb93d0231bbbc6045adf8a2443bc4e21c (diff)
Implement input type configs (#3784)
Add support for configurations that apply to a type of inputs (i.e. natural scrolling on all touchpads). A type config is differentiated by a `type:` prefix followed by the type it corresponds to. When new devices appear, the device config is merged on top of its type config (if it exists). New type configs are applied on top of existing configs.
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index 4944ec02..e14ea83a 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -113,6 +113,12 @@ void free_config(struct sway_config *config) {
}
list_free(config->input_configs);
}
+ if (config->input_type_configs) {
+ for (int i = 0; i < config->input_type_configs->length; i++) {
+ free_input_config(config->input_type_configs->items[i]);
+ }
+ list_free(config->input_type_configs);
+ }
if (config->seat_configs) {
for (int i = 0; i < config->seat_configs->length; i++) {
free_seat_config(config->seat_configs->items[i]);
@@ -189,10 +195,12 @@ static void config_defaults(struct sway_config *config) {
if (!(config->workspace_configs = create_list())) goto cleanup;
if (!(config->criteria = create_list())) goto cleanup;
if (!(config->no_focus = create_list())) goto cleanup;
- if (!(config->input_configs = create_list())) goto cleanup;
if (!(config->seat_configs = create_list())) goto cleanup;
if (!(config->output_configs = create_list())) goto cleanup;
+ if (!(config->input_type_configs = create_list())) goto cleanup;
+ if (!(config->input_configs = create_list())) goto cleanup;
+
if (!(config->cmd_queue = create_list())) goto cleanup;
if (!(config->current_mode = malloc(sizeof(struct sway_mode))))