diff options
author | ahoka <ahoka@pkgsrc.org> | 2008-12-21 10:23:23 +0000 |
---|---|---|
committer | ahoka <ahoka@pkgsrc.org> | 2008-12-21 10:23:23 +0000 |
commit | 716761c1c1fb0ce876d26388bee24061eb114faa (patch) | |
tree | 3e56e376e16f7303823d0cb6be19912265abe182 | |
parent | 3b146b1b6d992416478c6f414a38ce679c83d529 (diff) | |
download | pkgsrc-716761c1c1fb0ce876d26388bee24061eb114faa.tar.gz |
According to Section 12.4 of the XKB Protocol Spec, if a key only has a single
group but the keyboard has multiple groups defined, the core description of
the key is a duplication of the single group across all symbols. i.e.
G1L1 G1L2 G1L1 G1L2 G1L3 G1L4 G1L3 G1L4
The previous code generated G1L1 G1L2 G1L3 G1L4 G1L3 G1L4, leading to
"invented" groups when the process is reversed.
Note that this creates wrong key types on reconstruction from core to xkb,
i.e. any single-group key with a key type that is not one of the canonical
four (Sec 12.2.3), will get the assigned type on group 1, and a canonical type
for the other gruops.
X.Org Bug 14373 <http://bugs.freedesktop.org/show_bug.cgi?id=14373>
Patch taken from the bugtracker entry.
-rw-r--r-- | x11/modular-xorg-server/Makefile | 4 | ||||
-rw-r--r-- | x11/modular-xorg-server/distinfo | 3 | ||||
-rw-r--r-- | x11/modular-xorg-server/patches/patch-xkb | 83 |
3 files changed, 87 insertions, 3 deletions
diff --git a/x11/modular-xorg-server/Makefile b/x11/modular-xorg-server/Makefile index 6650da8086b..160635152b7 100644 --- a/x11/modular-xorg-server/Makefile +++ b/x11/modular-xorg-server/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.37 2008/11/10 17:21:38 wiz Exp $ +# $NetBSD: Makefile,v 1.38 2008/12/21 10:23:23 ahoka Exp $ # DISTNAME= xorg-server-1.4.2 PKGNAME= modular-${DISTNAME} -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= x11 MASTER_SITES= ${MASTER_SITE_XORG:=xserver/} EXTRACT_SUFX= .tar.bz2 diff --git a/x11/modular-xorg-server/distinfo b/x11/modular-xorg-server/distinfo index 58f65acbf9a..6e636b4c920 100644 --- a/x11/modular-xorg-server/distinfo +++ b/x11/modular-xorg-server/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.28 2008/10/29 22:20:28 bjs Exp $ +$NetBSD: distinfo,v 1.29 2008/12/21 10:23:23 ahoka Exp $ SHA1 (Mesa-7.0.4-xorg-server_GL) = 6aed65e64c7a684a5d707334a4b4fe7711966380 RMD160 (Mesa-7.0.4-xorg-server_GL) = 2028532d79f5bba1d09ae787a1799fc4b206a5d7 @@ -23,3 +23,4 @@ SHA1 (patch-sb) = b769780b446e4f10bc99ccd3373d666daf44f863 SHA1 (patch-sc) = 33c4d4731e3732032f84946fc17e28d0cba389a6 SHA1 (patch-sd) = ac8f5bc3bca8c21e91d7206a5b2cb400c54f7414 SHA1 (patch-se) = 22b20c734b7fcf59d75227aeb1fa703465582568 +SHA1 (patch-xkb) = 4bd5f8d86cf3ad2f351cf8407221cf79812ed8e6 diff --git a/x11/modular-xorg-server/patches/patch-xkb b/x11/modular-xorg-server/patches/patch-xkb new file mode 100644 index 00000000000..b031dc0372c --- /dev/null +++ b/x11/modular-xorg-server/patches/patch-xkb @@ -0,0 +1,83 @@ +From d9f2792dd4a6bc078bb58e22c55ee20c56aabe49 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer <peter.hutterer@redhat.com> +Date: Fri, 19 Sep 2008 18:27:24 +0930 +Subject: [PATCH] xkb: fix core keyboard map generation. #14373 + +According to Section 12.4 of the XKB Protocol Spec, if a key only has a single +group but the keyboard has multiple groups defined, the core description of +the key is a duplication of the single group across all symbols. i.e. +G1L1 G1L2 G1L1 G1L2 G1L3 G1L4 G1L3 G1L4 + +The previous code generated G1L1 G1L2 G1L3 G1L4 G1L3 G1L4, leading to +"invented" groups when the process is reversed. + +Note that this creates wrong key types on reconstruction from core to xkb, +i.e. any single-group key with a key type that is not one of the canonical +four (Sec 12.2.3), will get the assigned type on group 1, and a canonical type +for the other gruops. + +X.Org Bug 14373 <http://bugs.freedesktop.org/show_bug.cgi?id=14373> +--- + xkb/xkbUtils.c | 39 ++++++++++++++++++++++++++++++++++----- + 1 files changed, 34 insertions(+), 5 deletions(-) + +diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c +index 486446a..7e9f8d0 100644 +--- xkb/xkbUtils.c ++++ xkb/xkbUtils.c +@@ -504,6 +504,40 @@ CARD8 keysPerMod[XkbNumModifiers]; + if (groupWidth>2) + nOut= groupWidth; + } ++ ++ /* See XKB Protocol Sec, Section 12.4. ++ A 1-group key with ABCDE on a 2 group keyboard must be ++ duplicated across all groups as ABABCDECDE. ++ */ ++ if (nGroups == 1) ++ { ++ int idx; ++ ++ groupWidth = XkbKeyGroupWidth(xkb, key, XkbGroup1Index); ++ ++ /* AB..CDE... -> ABABCDE... */ ++ if (groupWidth > 0 && maxSymsPerKey >= 3) ++ pCore[2] = pCore[0]; ++ if (groupWidth > 1 && maxSymsPerKey >= 4) ++ pCore[3] = pCore[1]; ++ ++ /* ABABCDE... -> ABABCDECDE */ ++ idx = 2 + groupWidth; ++ while (groupWidth > 2 && ++ idx < maxSymsPerKey && ++ idx < groupWidth * 2) ++ { ++ pCore[idx] = pCore[idx - groupWidth + 2]; ++ idx++; ++ } ++ idx = 2 * groupWidth; ++ if (idx < 4) ++ idx = 4; ++ /* 3 or more groups: ABABCDECDEABCDEABCDE */ ++ for (n = 0; n < groupWidth && idx < maxSymsPerKey; n++) ++ pCore[idx++] = pXKB[n]; ++ } ++ + pXKB+= XkbKeyGroupsWidth(xkb,key); + nOut+= 2; + if (nGroups>1) { +@@ -525,11 +559,6 @@ CARD8 keysPerMod[XkbNumModifiers]; + } + pXKB+= XkbKeyGroupsWidth(xkb,key); + } +- if (!pCore[2] && !pCore[3] && maxSymsPerKey >= 6 && +- (pCore[4] || pCore[5])) { +- pCore[2] = pCore[4]; +- pCore[3] = pCore[5]; +- } + } + if (keyc->modifierMap[key]!=0) { + register unsigned bit,i,mask; +-- +1.5.4.3 + |