config: Prevent the main layer from being toggled

This is technically a backwards incompatible change, but is almost
always a product of the user's misapprehension of the layer model.
Better to just make it illegal and and issue a warning.
master
Raheman Vaiya 4 years ago
parent f4efe1f364
commit 7800299239
  1. 5
      src/descriptor.c

@ -209,6 +209,11 @@ int parse_descriptor(const char *descstr,
switch (type) {
case ARG_LAYER:
if (!strcmp(argstr, "main")) {
err("the main layer cannot be toggled");
return -1;
}
arg->idx = config_get_layer_index(config, argstr);
if (arg->idx == -1 || config->layers[arg->idx].type == LT_LAYOUT) {
err("%s is not a valid layer", argstr);

Loading…
Cancel
Save