[patch] xkbcomp: fixing an age-old warning

Benno Schulenberg bensberg at justemail.net
Tue Sep 9 13:37:18 PDT 2014


Hi,

For many keyboard layouts, starting X produces the following warning:

Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
                  Ignoring extra symbols

It is easily reproced with this command:

$ setxkbmap -print  |  xkbcomp -w 1  -  $DISPLAY

The warning is given because in the loads of overlapping data that
setxkbmap provides to xkbcomp, the <RALT> key first gets defined
with two symbols assigned to it [1], which automatically sets its
number of levels to 2, and then it gets redefined to the type of
ONE_LEVEL and with just one symbol assigned [2], but this redefining
mistakenly does not adjust the number of levels to 1.  Attached patch
fixes this.  The patch looks invasive, because it also inverts the if,
to make the condition more readable, but the basic change is this:

-    if (into->numLevels[group] >= from->numLevels[group])
+    if ((into->numLevels[group] >= from->numLevels[group]) && (from->defs.merge != MergeOverride))

This causes the number of levels to be forced to that of the new definition
when the merge is an Override (that is: a redefinition and not a real merge).

The patch is a fix for bug #57242
(https://bugs.freedesktop.org/show_bug.cgi?id=57242).

Benno


[1]  altwin:    key <RALT> { [ Alt_R, Meta_R ] };
[2]  level3:  key <RALT> { type[Group1]="ONE_LEVEL", symbols[Group1] = [ ISO_Level3_Shift ] };

-- 
http://www.fastmail.fm - The professional email service

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-When-overriding-a-key-also-adjust-its-number-of-levels.patch
Type: text/x-diff
Size: 1723 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140909/fbb0d71c/attachment.patch>


More information about the xorg-devel mailing list