mirror of
https://github.com/swaywm/sway.git
synced 2025-11-04 13:29:52 -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
|
|
@ -22,6 +22,14 @@ struct cmd_results *cmd_for_window(int argc, char **argv) {
|
|||
criteria->type = CT_COMMAND;
|
||||
criteria->cmdlist = join_args(argv + 1, argc - 1);
|
||||
|
||||
// Check if it already exists
|
||||
if (criteria_already_exists(criteria)) {
|
||||
sway_log(SWAY_DEBUG, "for_window already exists: '%s' -> '%s'",
|
||||
criteria->raw, criteria->cmdlist);
|
||||
criteria_destroy(criteria);
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
}
|
||||
|
||||
list_add(config->criteria, criteria);
|
||||
sway_log(SWAY_DEBUG, "for_window: '%s' -> '%s' added", criteria->raw, criteria->cmdlist);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue