Date: Tuesday, February 8, 2022 @ 13:33:56 Author: lcarlier Revision: 436565
upgpkg: xorg-server 21.1.3-2: add a patch to help brltty Added: xorg-server/trunk/0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch Modified: xorg-server/trunk/PKGBUILD -----------------------------------------------------------------+ 0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch | 87 ++++++++++ PKGBUILD | 15 + 2 files changed, 99 insertions(+), 3 deletions(-) Added: 0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch =================================================================== --- 0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch (rev 0) +++ 0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch 2022-02-08 13:33:56 UTC (rev 436565) @@ -0,0 +1,87 @@ +From 0217cc6e0cf5013366105a90f5f91ccc4bab5425 Mon Sep 17 00:00:00 2001 +From: Samuel Thibault <samuel.thiba...@ens-lyon.org> +Date: Wed, 26 Jan 2022 00:05:55 +0100 +Subject: [PATCH] xkb: fix XkbSetMap when changing a keysym without changing a + keytype + +As the comment says: + +"symsPerKey/mapWidths must be filled regardless of client-side flags" + +so we always have to call CheckKeyTypes which will notably fill mapWidths +and nTypes. That is needed for CheckKeySyms to work since it checks the +width. Without it, any request with XkbKeySymsMask but not +XkbKeyTypesMask will fail because of the missing width information, for +instance this: + + XkbDescPtr xkb; + if (!(xkb = XkbGetMap (dpy, XkbKeyTypesMask|XkbKeySymsMask, XkbUseCoreKbd))) { + fprintf (stderr, "ERROR getting map\n"); + exit(1); + } + XFlush (dpy); + XSync (dpy, False); + + XkbMapChangesRec changes = { .changed = 0 }; + int oneGroupType[XkbNumKbdGroups] = { XkbOneLevelIndex }; + + if (XkbChangeTypesOfKey(xkb, keycode, 1, XkbGroup1Mask, oneGroupType, &changes)) { + fprintf(stderr, "ERROR changing type of key\n"); + exit(1); + } + XkbKeySymEntry(xkb,keycode,0,0) = keysym; + + if (!XkbChangeMap(dpy,xkb,&changes)) { + fprintf(stderr, "ERROR changing map\n"); + exit(1); + } + + XkbFreeKeyboard (xkb, 0, TRUE); + XFlush (dpy); + XSync (dpy, False); + +This had being going under the radar since about ever until commit +de940e06f8733d87bbb857aef85d830053442cfe ("xkb: fix key type index check +in _XkbSetMapChecks") fixed checking the values of kt_index, which was +previously erroneously ignoring errors and ignoring all other checks, just +because nTypes was not set, precisely because CheckKeyTypes was not called. + +Note: yes, CheckKeyTypes is meant to be callable without XkbKeyTypesMask, it +does properly check for that and just fills nTypes and mapWidths in that +case. + +Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> +Signed-off-by: Laurent Carlier <lordhea...@gmail.com> +--- + xkb/xkb.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/xkb/xkb.c b/xkb/xkb.c +index bfc21de00..820cd7166 100644 +--- a/xkb/xkb.c ++++ b/xkb/xkb.c +@@ -2511,16 +2511,15 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, + } + } + +- if (!(req->present & XkbKeyTypesMask)) { +- nTypes = xkb->map->num_types; +- } +- else if (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, +- &nTypes, mapWidths, doswap)) { ++ /* nTypes/mapWidths/symsPerKey must be filled for further tests below, ++ * regardless of client-side flags */ ++ ++ if (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, ++ &nTypes, mapWidths, doswap)) { + client->errorValue = nTypes; + return BadValue; + } + +- /* symsPerKey/mapWidths must be filled regardless of client-side flags */ + map = &xkb->map->key_sym_map[xkb->min_key_code]; + for (i = xkb->min_key_code; i < xkb->max_key_code; i++, map++) { + register int g, ng, w; +-- +2.35.1 + Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-02-08 12:50:57 UTC (rev 436564) +++ PKGBUILD 2022-02-08 13:33:56 UTC (rev 436565) @@ -5,7 +5,7 @@ pkgname=('xorg-server' 'xorg-server-xephyr' 'xorg-server-xvfb' 'xorg-server-xnest' 'xorg-server-common' 'xorg-server-devel') pkgver=21.1.3 -pkgrel=1 +pkgrel=2 arch=('x86_64') license=('custom') groups=('xorg') @@ -19,13 +19,22 @@ #source=(${pkgbase}-${pkgver}::git+https://gitlab.freedesktop.org/xorg/xserver.git#commit=27a0ee32ccef8d621aaa758c804fc9a5ceeb5a56 source=(https://xorg.freedesktop.org/releases/individual/xserver/${pkgbase}-${pkgver}.tar.xz{,.sig} xvfb-run # with updates from FC master - xvfb-run.1) + xvfb-run.1 + 0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch) validpgpkeys=('FD0004A26EADFE43A4C3F249C6F7AE200374452D') # Povilas Kanapickas <povi...@radix.lt> sha512sums=('cf5fed023eadda62ae732f8c4d427c272ebe005188341290f3d03147042c103b00cbb94d86a0256da815fb9b9a3da315c21a05ee0c926c1a2ff0c54ab0c0638b' 'SKIP' '4154dd55702b98083b26077bf70c60aa957b4795dbf831bcc4c78b3cb44efe214f0cf8e3c140729c829b5f24e7466a24615ab8dbcce0ac6ebee3229531091514' - 'de5e2cb3c6825e6cf1f07ca0d52423e17f34d70ec7935e9dd24be5fb9883bf1e03b50ff584931bd3b41095c510ab2aa44d2573fd5feaebdcb59363b65607ff22') + 'de5e2cb3c6825e6cf1f07ca0d52423e17f34d70ec7935e9dd24be5fb9883bf1e03b50ff584931bd3b41095c510ab2aa44d2573fd5feaebdcb59363b65607ff22' + 'bc3b955072f320ae72a771bebecbcf56637cd0448c3afa28149fcd9e0de3700e9fba1fec21fe283be77e1236e317e385f6970eb59df54d3181324c229c8309d7') +prepare() { + cd ${pkgbase}-$pkgver + + # merged in main + patch -Np1 -i ../0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch +} + build() { # Since pacman 5.0.2-2, hardened flags are now enabled in makepkg.conf # With them, module fail to load with undefined symbol.