Make the cmd_find_* functions more obvious when looking for a client,

rather than having it inside other functions. Should be no change to the
way targets are resolved just yet.
This commit is contained in:
nicm
2017-04-21 20:26:34 +00:00
parent 2ad09ab5af
commit efaf4c16cf
7 changed files with 188 additions and 249 deletions

View File

@ -216,11 +216,12 @@ cmdq_fire_command(struct cmdq_item *item)
name = cmd->entry->name;
if (cmd_find_valid_state(&item->state.tflag))
fsp = &item->state.tflag;
else {
if (cmd_find_current(&fs, item, CMD_FIND_QUIET) != 0)
goto out;
else if (cmd_find_valid_state(&item->shared->current))
fsp = &item->shared->current;
else if (cmd_find_from_client(&fs, item->client) == 0)
fsp = &fs;
}
else
goto out;
hooks_insert(fsp->s->hooks, item, fsp, "after-%s", name);
}