summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Le Marre <dev@wismill.eu>2023-05-13 07:17:58 +0200
committerRan Benita <ran@unusedvar.com>2023-05-13 21:59:37 +0300
commit5fbffaf035f0c0edbcf7b2e747ccab9a234101ff (patch)
tree5b3f860223252084891eaa634e0c84e4a10bf797
parentc8efb70406f55d2696685c9392456be7824f4368 (diff)
downloadlibxkbcommon-5fbffaf035f0c0edbcf7b2e747ccab9a234101ff.tar.gz
libxkbcommon-5fbffaf035f0c0edbcf7b2e747ccab9a234101ff.tar.bz2
libxkbcommon-5fbffaf035f0c0edbcf7b2e747ccab9a234101ff.zip
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.
-rw-r--r--src/context-priv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/context-priv.c b/src/context-priv.c
index e94385f..30f3f05 100644
--- a/src/context-priv.c
+++ b/src/context-priv.c
@@ -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. */