aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2024-03-16 17:55:20 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2024-04-12 17:32:26 +0200
commit1267e47de913d2cda2644ad89bba4e9c55842cd3 (patch)
tree3595ce67416ff57f0cb50965664a3af5714a50be /include
parentinput: add Super as alternative for Mod4 (diff)
downloadsway-1267e47de913d2cda2644ad89bba4e9c55842cd3.tar.gz
sway-1267e47de913d2cda2644ad89bba4e9c55842cd3.tar.zst
sway-1267e47de913d2cda2644ad89bba4e9c55842cd3.zip
config/output: Refactor handling of tiered configs
Output configuration can be applied to a particular output in three ways: As a wildcard, by connector name and by identifier. This in turn means that three different configurations must be handled at any given time. In the current model, this is managed by merging new configuration into every other matching configuration. At the same time, an additional synthetic configuration is made which matchehes both identifier and name at the same time, further complicating logic. Instead, manage and store each configuration independently and merge them in order when retrieving configuration for an output. When changes are made to a less specific configuration, clear these fields from more specific configurations to allow the change to take effect regardless of precedence. Fixes: https://github.com/swaywm/sway/issues/8048
Diffstat (limited to 'include')
-rw-r--r--include/sway/config.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 40710199..0be1cd22 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -693,7 +693,14 @@ bool apply_output_configs(struct matched_output_config *configs,
693 693
694void apply_all_output_configs(void); 694void apply_all_output_configs(void);
695 695
696struct output_config *store_output_config(struct output_config *oc); 696/**
697 * store_output_config stores a new output config. An output may be matched by
698 * three different config types, in order of precedence: Identifier, name and
699 * wildcard. When storing a config type of lower precedence, assume that the
700 * user wants the config to take immediate effect by superseding (clearing) the
701 * same values from higher presedence configuration.
702 */
703void store_output_config(struct output_config *oc);
697 704
698struct output_config *find_output_config(struct sway_output *output); 705struct output_config *find_output_config(struct sway_output *output);
699 706