[PATCH xkbcomp] include resets group compatibility modifiers #43091

Andreas Wettstein wettstein509 at solnet.ch
Fri Dec 2 12:10:06 PST 2011


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 at solnet.ch>
---
 compat.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/compat.c b/compat.c
index 759535a..2b00142 100644
--- a/compat.c
+++ b/compat.c
@@ -50,6 +50,7 @@ typedef struct _GroupCompatInfo
 {
     unsigned char fileID;
     unsigned char merge;
+    Bool defined;
     unsigned char real_mods;
     unsigned short vmods;
 } GroupCompatInfo;
@@ -280,8 +281,8 @@ AddGroupCompat(CompatInfo * info, unsigned group, GroupCompatInfo * newGC)
         ACTION1("Using %s definition\n",
                 (merge == MergeAugment ? "old" : "new"));
     }
-    if (merge != MergeAugment)
-        *gc = *newGC;
+    if(newGC->defined && (merge != MergeAugment || !gc->defined))
+	*gc = *newGC;
     return True;
 }
 
@@ -715,6 +716,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);
 }
 
-- 
1.7.6



More information about the xorg-devel mailing list