diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-03-07 23:53:21 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-03-07 23:53:21 +0100 |
commit | d8a4f3be71bcf991e6fd30d10e8607aeaedc11d0 (patch) | |
tree | c8768a7402af7105ae41d782b114861e81656b44 | |
parent | c6f0e6b2c6164b7a0c160222f4af8f45e97153c1 (diff) | |
parent | 2794e674cbe9601339456ee08ced60aa6f759e3e (diff) | |
download | nx-libs-d8a4f3be71bcf991e6fd30d10e8607aeaedc11d0.tar.gz nx-libs-d8a4f3be71bcf991e6fd30d10e8607aeaedc11d0.tar.bz2 nx-libs-d8a4f3be71bcf991e6fd30d10e8607aeaedc11d0.zip |
Merge branch 'uli42-pr/backup_null_rulesfile' into 3.6.x
Attributes GH PR #372: https://github.com/ArcticaProject/nx-libs/pull/372
Fixes: ArcticaProject/nx-libs#371.
-rw-r--r-- | nx-X11/programs/Xserver/xkb/xkbInit.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index a93557a34..4553cce9e 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -92,7 +92,7 @@ typedef struct _SrvXkmInfo { #define XKB_BIN_DIRECTORY XKB_BASE_DIRECTORY #endif #ifndef XKB_DFLT_RULES_FILE -#define XKB_DFLT_RULES_FILE "rules" +#define XKB_DFLT_RULES_FILE "base" #endif #ifndef XKB_DFLT_KB_LAYOUT #define XKB_DFLT_KB_LAYOUT "us" @@ -244,14 +244,34 @@ XkbSetRulesUsed(XkbRF_VarDefsPtr defs) return; } +/** + * Set the default RMLVO for the next device to be initialised. + * If a parameter is NULL, the previous setting will be used. Use empty + * strings if you want to delete a previous setting. + * + * If @rulesFile is NULL and no previous @rulesFile has been set, the + * built-in default is chosen as default. + */ + void XkbSetRulesDflts(char *rulesFile,char *model,char *layout, char *variant,char *options) { - if (XkbRulesFile) - _XkbFree(XkbRulesFile); - XkbRulesFile= Xstrdup(rulesFile); - rulesDefined= True; + if (!rulesFile && !XkbRulesFile) + { + LogMessage(X_WARNING, "[xkb] No rule given, and no previous rule " + "defined. Defaulting to '%s'.\n", + XKB_DFLT_RULES_FILE); + rulesFile = XKB_DFLT_RULES_FILE; + } + + if (rulesFile) { + if (XkbRulesFile) + _XkbFree(XkbRulesFile); + XkbRulesFile= Xstrdup(rulesFile); + rulesDefined= True; + } + if (model) { if (XkbModelDflt) _XkbFree(XkbModelDflt); |