aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bind.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-28 11:08:54 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-28 11:09:01 -0500
commite5f90f25d755b19151dfcfd98790c1bad3eb8068 (patch)
treec6af192b469e6cf86ee00cb5d0ab4e03a98bacae /sway/commands/bind.c
parentMerge pull request #3211 from emersion/child-view-unmapped-segfault (diff)
downloadsway-e5f90f25d755b19151dfcfd98790c1bad3eb8068.tar.gz
sway-e5f90f25d755b19151dfcfd98790c1bad3eb8068.tar.zst
sway-e5f90f25d755b19151dfcfd98790c1bad3eb8068.zip
Introduce a way to show config warnings in swaynag
Adds the function `config_add_swaynag_warning(char *fmt, ...)` so that handlers can add warnings to the swaynag config log in a uniform way. The formatting is identical to errors and include the line number, line, and config path. This also alters the background file access warning to use the function and introduces a warning for duplicate bindings.
Diffstat (limited to 'sway/commands/bind.c')
-rw-r--r--sway/commands/bind.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 34881b0f..9112815f 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -255,8 +255,12 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
255 for (int i = 0; i < mode_bindings->length; ++i) { 255 for (int i = 0; i < mode_bindings->length; ++i) {
256 struct sway_binding *config_binding = mode_bindings->items[i]; 256 struct sway_binding *config_binding = mode_bindings->items[i];
257 if (binding_key_compare(binding, config_binding)) { 257 if (binding_key_compare(binding, config_binding)) {
258 wlr_log(WLR_DEBUG, "overwriting old binding with command '%s'", 258 wlr_log(WLR_INFO, "Overwriting binding '%s' for device '%s' "
259 config_binding->command); 259 "from `%s` to `%s`", argv[0], binding->input,
260 binding->command, config_binding->command);
261 config_add_swaynag_warning("Overwriting binding '%s' for device "
262 "'%s' to `%s` from `%s`", argv[0], binding->input,
263 binding->command, config_binding->command);
260 free_sway_binding(config_binding); 264 free_sway_binding(config_binding);
261 mode_bindings->items[i] = binding; 265 mode_bindings->items[i] = binding;
262 overwritten = true; 266 overwritten = true;