Unverified Commit d8a4f3be authored by Mihai Moldovan's avatar Mihai Moldovan

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.
parents c6f0e6b2 2794e674
...@@ -92,7 +92,7 @@ typedef struct _SrvXkmInfo { ...@@ -92,7 +92,7 @@ typedef struct _SrvXkmInfo {
#define XKB_BIN_DIRECTORY XKB_BASE_DIRECTORY #define XKB_BIN_DIRECTORY XKB_BASE_DIRECTORY
#endif #endif
#ifndef XKB_DFLT_RULES_FILE #ifndef XKB_DFLT_RULES_FILE
#define XKB_DFLT_RULES_FILE "rules" #define XKB_DFLT_RULES_FILE "base"
#endif #endif
#ifndef XKB_DFLT_KB_LAYOUT #ifndef XKB_DFLT_KB_LAYOUT
#define XKB_DFLT_KB_LAYOUT "us" #define XKB_DFLT_KB_LAYOUT "us"
...@@ -244,14 +244,34 @@ XkbSetRulesUsed(XkbRF_VarDefsPtr defs) ...@@ -244,14 +244,34 @@ XkbSetRulesUsed(XkbRF_VarDefsPtr defs)
return; 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 void
XkbSetRulesDflts(char *rulesFile,char *model,char *layout, XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
char *variant,char *options) char *variant,char *options)
{ {
if (XkbRulesFile) if (!rulesFile && !XkbRulesFile)
_XkbFree(XkbRulesFile); {
XkbRulesFile= Xstrdup(rulesFile); LogMessage(X_WARNING, "[xkb] No rule given, and no previous rule "
rulesDefined= True; "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 (model) {
if (XkbModelDflt) if (XkbModelDflt)
_XkbFree(XkbModelDflt); _XkbFree(XkbModelDflt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment