Bug 16872 - Incorrect layout loading for ro layout with std variant
Summary: Incorrect layout loading for ro layout with std variant
Status: RESOLVED FIXED
Alias: None
Product: xkeyboard-config
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: xkb
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 16975
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-28 03:14 UTC by Igor Stirbu
Modified: 2008-08-18 01:04 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Fix bad aliases (3.96 KB, patch)
2008-07-28 03:14 UTC, Igor Stirbu
Details | Splinter Review
Patch to fix the issue (4.47 KB, patch)
2008-07-28 05:07 UTC, Andrei Popescu
Details | Splinter Review
First version of parts patch (7.91 KB, patch)
2008-07-29 01:25 UTC, Igor Stirbu
Details | Splinter Review

Description Igor Stirbu 2008-07-28 03:14:56 UTC
Created attachment 17926 [details] [review]
Fix bad aliases

Hello,

This issue was detected when I tried to configure xkb with
multiple layouts. The following output shows the inconsistence:

$ setxkbmap -v 10 -layout us,ro,ru -variant ,std,phonetic
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Applied rules from xorg:
model:      pc104
layout:     us,ro,ru
variant:    ,std,phonetic
options:    grp:menu_toggle, ctrl:nocaps
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+ro(std_cedilla):2+ro(std):2+ru(phonetic):3+group(menu_toggle)+ctrl(nocaps)
geometry:   pc(pc104)

$ setxkbmap -v 10 -layout ro,us,ru -variant std,,phonetic
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Applied rules from xorg:
model:      pc104
layout:     ro,us,ru
variant:    std,,phonetic
options:    grp:menu_toggle, ctrl:nocaps
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc+ro(std)+us:2+ru(phonetic):3+group(menu_toggle)+ctrl(nocaps)
geometry:   pc(pc104)

Please notice that in both commands the variant requested for
'ro' layout was 'std'. The result of the first command was that
'std_cedilla' variant was loaded.

After inspecting /usr/share/X11/xkb/rules/base file I detected
the following issues:
- there are bad aliases (std is aliased to std_cedilla)
- references to the missing std_comma alias/variant

I've attached a patch that solves those issues and adds
'std_comma' and 'comma' variants for completeness.

Thanks,
Igor
Comment 1 Andrei Popescu 2008-07-28 05:07:43 UTC
Created attachment 17928 [details] [review]
Patch to fix the issue
Comment 2 Andrei Popescu 2008-07-28 05:10:18 UTC
Hello,

I think Igor's patch is incomplete as it doesn't add aliases for std_comma and comma everywhere.

This bug is probably a regression caused by the patch in bug 12377.

Regards,
Andrei
Comment 3 Igor Stirbu 2008-07-28 05:17:33 UTC
(In reply to comment #2)
> This bug is probably a regression caused by the patch in bug 12377.

I think you meant bug 13277.


Comment 4 Andrei Popescu 2008-07-28 05:55:30 UTC
Aaa, yes. Sorry, that was a typo.

Regards,
Andrei
Comment 5 Igor Stirbu 2008-07-28 08:40:08 UTC
Hello,

During the investigation of this issue I could not find
clear answers that would cover these questions:

- why add new aliases in 10 places for completeness?

and depending on the answer of the previous question:

- is it ok to add 'aliases' in symbol/xx file?

so instead of adding this several times in rules/base

 * ro(std_foo) = pc+ro(std)

this could be added in symbol/ro file:

partial alphanumeric_keys
xkb_symbols "std_foo" {
    include "ro(std)"
    name[Group1]="Romania - Standard (Foo)";
};

Thanks,
Igor Stirbu
Comment 6 Sergey V. Udaltsov 2008-07-28 08:43:16 UTC
> - why add new aliases in 10 places for completeness?
In order not to break existing configurations.

> and depending on the answer of the previous question:
> 
> - is it ok to add 'aliases' in symbol/xx file?
No.

Actually, the patch is not correct - it is modifying the resulting rules/base file instead of modifying the components it is built from.
Comment 7 Andrei Popescu 2008-07-28 08:48:50 UTC
I will gladly provide a better one, I just didn't know what the components are.

Regards,
Andrei
Comment 8 Igor Stirbu 2008-07-29 01:25:33 UTC
Created attachment 17954 [details] [review]
First version of parts patch

This patch modifies rules/compat/*.part files where
the romanian layout is specified. The resulted base
file seem to be correct but I am not able to load
any variant using alias. For example,

setxkbmap -layout ro -variant comma

works but this one fails:

$ setxkbmap -v -layout us,ro,ru -variant ,comma,phonetic
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+ro(basic):2+ro(comma):2+ru(phonetic):3+group(menu_toggle)+ctrl(nocaps)
geometry:   pc(pc104)
Error loading new keyboard description

where comma is an alias to basic variant. Are there any
other files that need to be updated besides parts?

Thanks,
Igor
Comment 9 Andrei Popescu 2008-07-30 02:10:30 UTC
Hello Igor,

I'm not sure this is supposed to work. According to setxkbmap(1):

-layout name
         Specifies  the  name  of  the layout used to determine the components
         which make up the keyboard description.  Only one layout may be
         specified on the command line.

[...]

-variant name
          Specifies which variant of the keyboard layout should be used to
          determine the components which make  up  the  keyboard description.
          Only one variant may be specified on the command line.

Regards,
Andrei
Comment 10 Sergey V. Udaltsov 2008-07-30 02:13:55 UTC
man page for setxkbmap is out of date.
Comment 11 Andrei Popescu 2008-08-03 07:55:08 UTC
Hello,

It would be nice to solve this bug for Debian Lenny, which is already in freeze. 

Are there any other files that need to be modified so the "comma" variant will work as an alias to "basic"?

Regards,
Andrei
Comment 12 Sergey V. Udaltsov 2008-08-03 14:59:41 UTC
First, thanks for your patch. I committed it. 
Second, after I really rebuilt everything, I am getting more interesting output for setxkbmap -v -model pc -layout us,ro,ru -variant ,comma,phonetic -print:

keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+ro(basic):2+ro(comma):2+ru(phonetic):3
geometry:   pc(pc104)
xkb_keymap {
	xkb_keycodes  { include "xfree86+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+ro(basic):2+ro(comma):2+ru(phonetic):3"	};
	xkb_geometry  { include "pc(pc104)"	};
};

Rather strange, isn't it? I will try to contact Daniel Stone, since he knows the rules engine internals better than me, he might give some insight...
Comment 13 Andrei Popescu 2008-08-04 00:11:00 UTC
I rebuilt the Debian package with Igor's patch and I get the same as you (if it helps to know). Please contact us if there is anything else to do.

Regards,
Andrei
Comment 14 Igor Stirbu 2008-08-04 03:31:13 UTC
Hello,

Another Debian specific issue that I've reported [1]
is that the symbols.dir is not updated when manually
building the xkb-data (xkeyboard-config) package.

After building a package with updated symbols.dir file
the alias variants are still not loading. I thought
this might be helpful.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=492973

Thanks,
Igor
Comment 15 Sergey V. Udaltsov 2008-08-04 15:30:16 UTC
> symbols.dir is not updated

This is perfectly valid bug report - but could you please report it separately?

Thanks
Comment 16 Igor Stirbu 2008-08-05 00:21:51 UTC
Hello,

(In reply to comment #15)
> > symbols.dir is not updated
> 
> This is perfectly valid bug report - but could you please report it separately?

Actually this bug is Debian specific and I've
mentioned it here because several people in CC
are Debian developers/contributors. This is not
a xkeyboard-config bug.

Sergey, you've mentioned that the last patch
was commited. I've pulled the latest changes
from the git tree and the patch for the commit
8e253e1bedfaf4beba3763c1e6b9ef4a706487a3 does
not contain all the changes, it updates only
rules/compat/variantRename.lst. Just wondering
because you did not mention about this fact.

Thanks,
Igor
Comment 17 Sergey V. Udaltsov 2008-08-05 00:34:11 UTC
Igor,

> Actually this bug is Debian specific and I've
No it is not:) I checked yesterday - the .dir files are not being regenerated properly.

> rules/compat/variantRename.lst. Just wondering
> because you did not mention about this fact.
If you look at rules/compat/Makefile.am, other files are generated from variantRename.lst.
Comment 18 Igor Stirbu 2008-08-05 01:11:51 UTC
Sergey,

(In reply to comment #17)
> > rules/compat/variantRename.lst. Just wondering
> > because you did not mention about this fact.
> If you look at rules/compat/Makefile.am, other files are generated from
> variantRename.lst.

How come the generated files from rules/compat are
kept in repository? The only part file that is not
generated is 'base.o_s.part'. This makes things
really confusing, especially with this patch business.

Thanks,
Igor
Comment 19 Sergey V. Udaltsov 2008-08-06 16:14:29 UTC
> How come the generated files from rules/compat are
> kept in repository? 
I'd say "historically". May be you're right, they should be removed. I'll think of it.

> The only part file that is not
> generated is 'base.o_s.part'. This makes things
> really confusing, especially with this patch business.
Well, may be it is confusing a bit. Though for the person who's able to read Makefile.am, it should be relatively easy to get the general idea...
Comment 20 Andrei Popescu 2008-08-10 05:03:56 UTC
Hello,

If the Debian maintainer were to fix this *and only this* issue, would it be enough to use the patch in 8e253e1bedfaf4beba3763c1e6b9ef4a706487a3 or is it also necessary to fix the .dir issue in bug 17008?

Regards,
Andrei
Comment 21 Sergey V. Udaltsov 2008-08-10 05:19:43 UTC
I'd say 17008 is pretty much irrelevant.
Comment 22 Andrei Popescu 2008-08-10 06:38:25 UTC
Ok, but what about the issue in comment #12? More interesting, it doesn't appear when using ro as the first layout:

$ setxkbmap -v 10 ro,de comma
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Applied rules from xorg:
model:      pc105
layout:     ro,de
variant:    comma
options:    grp:alt_shift_toggle
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc+ro+de:2+group(alt_shift_toggle)
geometry:   pc(pc105)

but

$ setxkbmap -v 10 de,ro ,comma
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Applied rules from xorg:
model:      pc105
layout:     de,ro
variant:    ,comma
options:    grp:alt_shift_toggle
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc+de+ro(basic):2+ro(comma):2+group(alt_shift_toggle)
geometry:   pc(pc105)
Error loading new keyboard description

Is this a different bug?

Regards,
Andrei
Comment 23 Sergey V. Udaltsov 2008-08-10 06:42:01 UTC
The actual issue is a reality, 100% reproducable. I'd say it an issue with setxkbmap (the way it handles rules). That is why I need #16975 fixed first - I do not see why setxkbmap behaves so strangely...
Comment 24 Igor Stirbu 2008-08-18 01:04:12 UTC
Hello,

I suppose this bug can be safely closed as the main
issue addressed in it was fixed in commit 
8e253e1bedfaf4beba3763c1e6b9ef4a706487a3.

Thanks,
Igor


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.