include resets group compatibility modifiers #43091 This change makes sure that include does not overwrite previous compatibility modifier settings when the included files does not explicitly specify them. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Daniel Stone <daniel@fooishbar.org> [Cross-picked from xkbcomp commit 14470719.]
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 91c9df2..5db2950 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -50,6 +50,7 @@ typedef struct _GroupCompatInfo
{
unsigned char fileID;
unsigned char merge;
+ Bool defined;
unsigned char real_mods;
xkb_atom_t vmods;
} GroupCompatInfo;
@@ -278,7 +279,7 @@ AddGroupCompat(CompatInfo * info, unsigned group, GroupCompatInfo * newGC)
ACTION("Using %s definition\n",
(merge == MergeAugment ? "old" : "new"));
}
- if (merge != MergeAugment)
+ if (newGC->defined && (merge != MergeAugment || !gc->defined))
*gc = *newGC;
return True;
}
@@ -697,6 +698,7 @@ HandleGroupCompatDef(GroupCompatDef * def,
}
tmp.real_mods = val.uval & 0xff;
tmp.vmods = (val.uval >> 8) & 0xffff;
+ tmp.defined = True;
return AddGroupCompat(info, def->group - 1, &tmp);
}