mirror of
https://github.com/swaywm/sway.git
synced 2025-11-09 13:29:49 -05:00
Avoid adding duplicate criteria for no_focus and command
This commit is contained in:
parent
17c9a0e84f
commit
e4bba906b6
4 changed files with 53 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue