xserver: Branch 'master' - 4 commits

Peter Hutterer whot at kemper.freedesktop.org
Thu Sep 25 17:12:53 PDT 2008


 config/hal.c    |    5 +++--
 xfixes/cursor.c |    3 ++-
 xkb/XKBMisc.c   |   13 ++++++++++---
 xkb/xkbUtils.c  |   39 ++++++++++++++++++++++++++++++++++-----
 4 files changed, 49 insertions(+), 11 deletions(-)

New commits:
commit feaa5fa6712c8c6f4ca97766e2ac0338253cf3b8
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Thu Sep 25 11:03:22 2008 +0930

    xfixes: realize the invisible cursor before displaying it.
    
    AllocARGBCursor realizes the cursor but can only do so if we have devices
    there already. If we don't - then the cursor needs to be realized elsewhere.
    This is usually done in InitializeSprite, but since xfixes just hard-swaps the
    (realized) cursor to the InvisibleCursor, we need to manually realize it
    before trying to display it.

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 2a42a0b..2c584f9 100755
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -142,7 +142,8 @@ CursorDisplayCursor (DeviceIntPtr pDev,
 	CursorVisible = TRUE;
 
     if (cs->pCursorHideCounts != NULL || !CursorVisible) {
-	ret = (*pScreen->DisplayCursor) (pDev, pScreen, pInvisibleCursor);
+        ret = ((*pScreen->RealizeCursor)(pDev, pScreen, pInvisibleCursor) &&
+	       (*pScreen->DisplayCursor) (pDev, pScreen, pInvisibleCursor));
     } else {
 	ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
     }
commit e58be0f3425fb3e946a222077672c3c01308f887
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Tue Sep 23 10:01:30 2008 +0930

    config: print error code if NIDR fails.

diff --git a/config/hal.c b/config/hal.c
index 3e0ff08..6573efe 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -174,6 +174,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
     DeviceIntPtr dev = NULL;
     DBusError error;
     struct xkb_options xkb_opts = {0};
+    int rc;
 
     LibHalPropertySet *set = NULL;
 	LibHalPropertySetIterator set_iter;
@@ -372,8 +373,8 @@ device_added(LibHalContext *hal_ctx, const char *udi)
 
     /* this isn't an error, but how else do you output something that the user can see? */
     LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
-    if (NewInputDeviceRequest(options, &dev) != Success) {
-        LogMessage(X_ERROR, "config/hal: NewInputDeviceRequest failed\n");
+    if ((rc = NewInputDeviceRequest(options, &dev)) != Success) {
+        LogMessage(X_ERROR, "config/hal: NewInputDeviceRequest failed (%d)\n", rc);
         dev = NULL;
         goto unwind;
     }
commit 30c3c13f1030268aaa6a3598d538fafd0592d77a
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Mon Sep 22 11:10:46 2008 +0930

    xkb: squash canonical types into explicit ones on core reconstruction.
    
    If we update key types from core, and groups 2 - n have a canonical type but
    the same symbols as the explicit type of group 1, assume that it was a core
    sym duplication according to Section 12.4 of the XKB Protocol Spec.
    Ignore the canonical types and pretend there's only one group for the key -
    with the explicit key type.
    
    The protocol spec does not cover this case, so we have to guess here.

diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c
index eb5c381..6f63c2b 100644
--- a/xkb/XKBMisc.c
+++ b/xkb/XKBMisc.c
@@ -178,16 +178,23 @@ int		nGroups,tmp,groupsWidth;
 	}
     }
 
-    /* step 7: check for all groups identical or all width 1 */
+    /* step 7: check for all groups identical or all width 1
+     *
+     * Special feature: if group 1 has an explicit type and all other groups
+     * have canonical types with same symbols, we assume it's info lost from
+     * the core replication.
+     */
     if (nGroups>1) {
-	Bool sameType,allOneLevel;
+	Bool sameType,allOneLevel, canonical = True;
 	allOneLevel= (xkb->map->types[types_inout[0]].num_levels==1);
 	for (i=1,sameType=True;(allOneLevel||sameType)&&(i<nGroups);i++) {
 	    sameType=(sameType&&(types_inout[i]==types_inout[XkbGroup1Index]));
 	    if (allOneLevel)
 		allOneLevel= (xkb->map->types[types_inout[i]].num_levels==1);
+	    if (types_inout[i] > XkbLastRequiredType)
+		canonical = False;
 	}
-	if ((sameType)&&
+	if (((sameType) || canonical)&&
 	    (!(protected&(XkbExplicitKeyTypesMask&~XkbExplicitKeyType1Mask)))){
 	    register int s;
 	    Bool	identical;
commit ae986d1c73d2f720bd0309d8c33328d14e8eed25
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Fri Sep 19 18:27:24 2008 +0930

    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>

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 486446a..7e9f8d0 100644
--- a/xkb/xkbUtils.c
+++ b/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;


More information about the xorg-commit mailing list