Add warning when RMLVO with no layout but variant set

There is no feedback that they are both replaced with default values.
Fix it by adding a warning informing about missing layout and show the
defaults for both.
master
Pierre Le Marre 2023-05-13 07:17:58 +02:00 committed by Ran Benita
parent c8efb70406
commit 5fbffaf035
1 changed files with 10 additions and 0 deletions

View File

@ -179,6 +179,16 @@ xkb_context_sanitize_rule_names(struct xkb_context *ctx,
* the caller and one from the environment. */
if (isempty(rmlvo->layout)) {
rmlvo->layout = xkb_context_get_default_layout(ctx);
if (!isempty(rmlvo->variant)) {
const char *variant = xkb_context_get_default_variant(ctx);
log_warn(ctx,
"Layout not provided, but variant set to \"%s\": "
"ignoring variant and using defaults for both: "
"layout=\"%s\", variant=\"%s\".\n",
rmlvo->variant,
rmlvo->layout,
variant ? variant : "");
}
rmlvo->variant = xkb_context_get_default_variant(ctx);
}
/* Options can be empty, so respect that if passed in. */