diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c index 14322c1..d309ccb 100644 --- a/src/xkbcomp/compat.c +++ b/src/xkbcomp/compat.c @@ -779,12 +779,12 @@ CopyInterps(CompatInfo * info, } bool -CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge, - LEDInfoPtr *unboundLEDs) +CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge) { int i; CompatInfo info; GroupCompatInfo *gcm; + LEDInfo *unbound = NULL, *next; InitCompatInfo(&info, keymap); info.dflt.defs.merge = merge; @@ -820,11 +820,21 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge } if (info.leds != NULL) { - if (!CopyIndicatorMapDefs(keymap, info.leds, unboundLEDs)) + if (!CopyIndicatorMapDefs(keymap, info.leds, &unbound)) info.errorCount++; info.leds = NULL; } + if (!BindIndicators(keymap, true, unbound, NULL)) { + while (unbound) { + next = (LEDInfo *) unbound->defs.next; + free(unbound); + unbound = next; + } + + goto err_info; + } + ClearCompatInfo(&info, keymap); return true; diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c index c4a572f..9b84ab4 100644 --- a/src/xkbcomp/keymap.c +++ b/src/xkbcomp/keymap.c @@ -39,7 +39,6 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file) bool ok; enum xkb_file_type mainType; const char *mainName; - LEDInfo *unbound = NULL, *next; struct xkb_keymap *keymap = XkbcAllocKeyboard(ctx); struct { XkbFile *keycodes; @@ -144,7 +143,7 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file) goto err; } if (sections.compat == NULL || - !CompileCompatMap(sections.compat, keymap, MERGE_OVERRIDE, &unbound)) + !CompileCompatMap(sections.compat, keymap, MERGE_OVERRIDE)) { ERROR("Failed to compile compat map\n"); goto err; @@ -156,10 +155,6 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file) goto err; } - ok = BindIndicators(keymap, true, unbound, NULL); - if (!ok) - goto err; - ok = UpdateModifiersFromCompat(keymap); if (!ok) goto err; @@ -169,10 +164,5 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file) err: ACTION("Failed to compile keymap\n"); xkb_map_unref(keymap); - while (unbound) { - next = (LEDInfo *) unbound->defs.next; - free(unbound); - unbound = next; - } return NULL; } diff --git a/src/xkbcomp/xkbcomp.h b/src/xkbcomp/xkbcomp.h index 2bc46b5..cf6b5ee 100644 --- a/src/xkbcomp/xkbcomp.h +++ b/src/xkbcomp/xkbcomp.h @@ -258,11 +258,9 @@ extern bool CompileKeyTypes(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge); -typedef struct _LEDInfo *LEDInfoPtr; - extern bool CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, - enum merge_mode merge, LEDInfoPtr *unboundLEDs); + enum merge_mode merge); extern bool CompileSymbols(XkbFile *file, struct xkb_keymap *keymap,