From a915739887477b28d924ecc8417ee107d125bd6c Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 6 Sep 2009 18:48:27 +0000 Subject: Switched to xorg-server-1.6.99.900.tar.gz --- xorg-server/xkb/XKBMisc.c | 88 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 22 deletions(-) (limited to 'xorg-server/xkb/XKBMisc.c') diff --git a/xorg-server/xkb/XKBMisc.c b/xorg-server/xkb/XKBMisc.c index a9d8b17c0..867906046 100644 --- a/xorg-server/xkb/XKBMisc.c +++ b/xorg-server/xkb/XKBMisc.c @@ -32,8 +32,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#define NEED_EVENTS -#define NEED_REPLIES #include #include "misc.h" #include "inputstr.h" @@ -58,6 +56,7 @@ register int i; unsigned int empty; int nSyms[XkbNumKbdGroups]; int nGroups,tmp,groupsWidth; +BOOL replicated = FALSE; /* Section 12.2 of the protocol describes this process in more detail */ /* Step 1: find the # of symbols in the core mapping per group */ @@ -91,27 +90,70 @@ int nGroups,tmp,groupsWidth; for (i=2;i=map_width)&& - ((protected&(XkbExplicitKeyType3Mask|XkbExplicitKeyType4Mask))==0)) { + + /* Special case: if only the first group is explicit, and the symbols + * replicate across all groups, then we have a Section 12.4 replication */ + if ((protected & ~XkbExplicitKeyType1Mask) == 0) + { + int j, width = nSyms[XkbGroup1Index]; + + replicated = TRUE; + + /* Check ABAB in ABABCDECDEABCDE */ + if ((width > 0 && CORE_SYM(0) != CORE_SYM(2)) || + (width > 1 && CORE_SYM(1) != CORE_SYM(3))) + replicated = FALSE; + + /* Check CDECDE in ABABCDECDEABCDE */ + for (i = 2; i < width && replicated; i++) + { + if (CORE_SYM(2 + i) != CORE_SYM(i + width)) + replicated = FALSE; + } + + /* Check ABCDE in ABABCDECDEABCDE */ + for (j = 2; replicated && + j < XkbNumKbdGroups && + map_width >= width * (j + 1); j++) + { + for (i = 0; i < width && replicated; i++) + { + if (CORE_SYM(((i < 2) ? i : 2 + i)) != CORE_SYM(i + width * j)) + replicated = FALSE; + } + } + } + + if (replicated) + { + nSyms[XkbGroup2Index]= 0; nSyms[XkbGroup3Index]= 0; nSyms[XkbGroup4Index]= 0; - nGroups= 2; - } - else { - nGroups= 3; - for (i=0;i=map_width)&& + ((protected&(XkbExplicitKeyType3Mask|XkbExplicitKeyType4Mask))==0)) { + nSyms[XkbGroup3Index]= 0; + nSyms[XkbGroup4Index]= 0; + nGroups= 2; + } else + { + nGroups= 3; + for (i=0;ichanged|= changed; } if (interps!=ibuf) - _XkbFree(interps); + xfree(interps); return True; } -- cgit v1.2.3