mirror of
https://github.com/swaywm/sway.git
synced 2026-04-25 06:46:24 -04:00
cmd_bar: fix bar id issues
Allows bar-subcommand to be a valid bar-ids Destroys runtime created bar if trying to use a config only subcommand Allow subcommands (except for id) to be ids
This commit is contained in:
parent
2340b14eba
commit
84b28dc593
2 changed files with 19 additions and 2 deletions
|
|
@ -13,6 +13,8 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
|
|||
const char *oldname = config->current_bar->id;
|
||||
if (strcmp(name, oldname) == 0) {
|
||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL); // NOP
|
||||
} else if (strcmp(name, "id") == 0) {
|
||||
return cmd_results_new(CMD_INVALID, "id", "id cannot be 'id'");
|
||||
}
|
||||
// check if id is used by a previously defined bar
|
||||
for (int i = 0; i < config->bars->length; ++i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue