summaryrefslogtreecommitdiff
path: root/setxkbmap.c
diff options
context:
space:
mode:
authorVan de Bugger <van.de.bugger@gmail.com>2011-02-28 03:35:25 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-28 10:53:06 +1000
commit6ce6ab87472b7d227393ea1058424439168683cc (patch)
tree637b7821706b7d7c159523302c3028d066b0d340 /setxkbmap.c
parente4387240c3c78014561fc2821cba5a944449599f (diff)
Few messages added for easier troubleshooting.
If setxkbmap fails to load rules file, it is not possible to find out where setxkbmap looks for it. Increasing verbosity level does not help: $ ./setxkbmap -v 10 Setting verbose level to 10 locale is C Couldn't find rules file (evdev) The problem fixed by adding two messages: before loading file and after successful loading. Messages are displayed if verbosity level is 8 or higher: $ ./setxkbmap -v 10 Setting verbose level to 10 locale is C Trying to load rules file ./rules/evdev... Trying to load rules file /usr/local/share/X11/xkb/rules/evdev... Couldn't find rules file (evdev) Signed-off-by: Van de Bugger <van.de.bugger@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'setxkbmap.c')
-rw-r--r--setxkbmap.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/setxkbmap.c b/setxkbmap.c
index 04c3fdf..88adea7 100644
--- a/setxkbmap.c
+++ b/setxkbmap.c
@@ -186,6 +186,7 @@ FILE *findFileInPath(char *name);
Bool addStringToOptions(char *opt_str, list_t *opts);
char *stringFromOptions(char *orig, list_t *newOpts);
Bool applyConfig(char *name);
+XkbRF_RulesPtr tryLoadRules(char *name, char *locale, Bool wantDesc, Bool wantRules);
Bool applyRules(void);
Bool applyComponentNames(void);
void printKeymap(void);
@@ -804,6 +805,19 @@ applyConfig(char *name)
return True;
}
+XkbRF_RulesPtr
+tryLoadRules(char *name, char *locale, Bool wantDesc, Bool wantRules)
+{
+ XkbRF_RulesPtr rules = NULL;
+ VMSG1(7, "Trying to load rules file %s...\n", name);
+ rules = XkbRF_Load(name, locale, wantDesc, wantRules);
+ if (rules)
+ {
+ VMSG(7, "Success.\n");
+ }
+ return rules;
+}
+
/**
* If any of model, layout, variant or options is specified, then compile the
* options into the
@@ -839,7 +853,7 @@ applyRules(void)
if (rfName[0] == '/')
{
- rules = XkbRF_Load(rfName, settings.locale.value, True, True);
+ rules = tryLoadRules(rfName, settings.locale.value, True, True);
}
else
{
@@ -854,7 +868,7 @@ applyRules(void)
inclPath.item[i], rfName);
continue;
}
- rules = XkbRF_Load(buf, settings.locale.value, True, True);
+ rules = tryLoadRules(buf, settings.locale.value, True, True);
}
}
if (!rules)