aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/no_focus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/no_focus.c')
-rw-r--r--sway/commands/no_focus.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/commands/no_focus.c b/sway/commands/no_focus.c
index 07e824a1..2001e04f 100644
--- a/sway/commands/no_focus.c
+++ b/sway/commands/no_focus.c
@@ -18,7 +18,16 @@ struct cmd_results *cmd_no_focus(int argc, char **argv) {
return error;
}
+
criteria->type = CT_NO_FOCUS;
+
+ // Check if it already exists
+ if (criteria_already_exists(criteria)) {
+ sway_log(SWAY_DEBUG, "no_focus already exists: '%s'", criteria->raw);
+ criteria_destroy(criteria);
+ return cmd_results_new(CMD_SUCCESS, NULL);
+ }
+
list_add(config->criteria, criteria);
return cmd_results_new(CMD_SUCCESS, NULL);