Bug 8452 - Compatibility rules are broken with several groups
Summary: Compatibility rules are broken with several groups
Status: RESOLVED FIXED
Alias: None
Product: xkeyboard-config
Classification: Unclassified
Component: doc (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: xkb
QA Contact:
URL:
Whiteboard:
Keywords:
: 17184 26088 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-28 16:27 UTC by Denis Barbier
Modified: 2011-10-28 02:18 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Denis Barbier 2006-09-28 16:27:00 UTC
I did not investigate yet:
  $ setxkbmap -model pc105 -layout ben -variant probhat  -print
  xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc(pc105)+in(ben_probhat)"     };
        xkb_geometry  { include "pc(pc105)"     };
  };
Looks good.  Now
  $ setxkbmap -model pc105 -layout us,ben -variant ,probhat  -print
  xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include
"pc(pc105)+us+in(ben)(probhat):2+in(ben_probhat):2"     };
        xkb_geometry  { include "pc(pc105)"     };
  };

There are 2 problems, I do not know if they are related:
  * in(ben)(probhat):2 should be in(ben_probhat):2
  * the 2nd group appears twice.
Comment 1 Sergey V. Udaltsov 2006-09-28 16:34:34 UTC
First variant is ok. But the second is broken. I'll have a look...
Comment 2 Sergey V. Udaltsov 2006-09-28 16:43:12 UTC
OK, I think I know why it happens. I am just not sure yet what would be the
proper way to fix. We have:

! model         layout                          =       symbols
...
  $pcmodels     ben                     =       pc(%m)+in(ben)
  *             ben                     =       pc(pc105)+in(ben)
...

then

! layout[2]     =       symbols
...
  ben(probhat)  =       +in(ben_probhat):2
...

Both rules applied, we got this incorrect double entry...
Now I am thinking what would be the right solution.
Comment 3 Sergey V. Udaltsov 2006-09-28 16:52:13 UTC
Actually even this works ok:

$ setxkbmap -model pc105 -layout 'us,ben(probhat)' -option '' -print
xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc(pc105)+us+in(ben_probhat):2"        };
        xkb_geometry  { include "pc(pc105)"     };
};

The problem arises when variant is put as a separate option. So the $100 is how
to fix it. With all fairness, I'd consider it as a bug in xkbcomp (i.e.
libxkbfile actually).
Comment 4 Denis Barbier 2006-09-29 02:24:56 UTC
Here is another test:
  $ setxkbmap -model pc105 -layout ben,us -variant basic, -print
  xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+in(ben)(basic)+us:2"      };
        xkb_geometry  { include "pc(pc105)"     };
  };

But if in rules/base, section
  ! model    layout[1]   variant[1]  =   symbols
is moved *before*
  ! model    layout[1]               =   symbols
then I get:
  $ setxkbmap -model pc105 -layout ben,us -variant basic, -print
  xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+in(ben)+us:2"       };
        xkb_geometry  { include "pc(pc105)"     };
  };
which is just fine.

Unfortunately doing the same for 2nd layout does not help:
  $ setxkbmap -model pc105 -layout us,ben -variant ,basic -print
  xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us+in(ben):2+in(ben)(basic):2"      };
        xkb_geometry  { include "pc(pc105)"     };
  };

My conclusions so far are:
  * Most specific sections must always appear before generic
    ones in rules/base.
  * Scripts in rules/compat/*.sh must be fixed so that when
    an old layout in layoutRename.lst is expanded into an
    expression with a paren, the %(v[N]) part is omitted.
    With these 2 changes, compat rules should be fixed for
    the first layout.
  * xkbcomp seems to handle the first layout in a special
    way; other layouts should be fixed as well so that
    when a
       model[N] layout[N] variant[N]  =   symbols
    section matches,
       model[N] layout[N]             =   symbols
    is ignored.

It would also be nice to put comments into *Rename.lst files,
which are of course removed when rules/base is written, to
keep track of dates of additions and remove those entries
after a sufficient amount of time.
Comment 5 Sergey V. Udaltsov 2009-01-02 14:13:03 UTC
*** Bug 17184 has been marked as a duplicate of this bug. ***
Comment 6 Sergey V. Udaltsov 2009-01-02 17:17:16 UTC
Denis, if you're still around, I'd love some more discussion about your proposals...

> * Most specific sections must always appear before generic
    ones in rules/base.
As I understand, this means:
- "numbered" sections should go before "unnumbered"
- sections with variants should go before sections with just layouts
Right? Am I missing anything in your idea?

> * Scripts in rules/compat/*.sh must be fixed so that when
    an old layout in layoutRename.lst is expanded into an
    expression with a paren, the %(v[N]) part is omitted.
    With these 2 changes, compat rules should be fixed for
    the first layout.
Good point. Clearly a bug here. Committed a fix (please check).

  * xkbcomp seems to handle the first layout in a special
    way; other layouts should be fixed as well so that
    when a
       model[N] layout[N] variant[N]  =   symbols
    section matches,
       model[N] layout[N]             =   symbols
    is ignored.
Should we open a separate bug against xkbcomp?
Comment 7 Sergey V. Udaltsov 2009-01-02 17:24:22 UTC
For #2, the fix is

http://cgit.freedesktop.org/xkeyboard-config/commit/?id=f914bfdf5016461cbe849dea21b9056f3c6149a7

Just for the record...
Comment 8 Julien Cristau 2009-04-22 05:43:08 UTC
Hi Sergey,

debian bug#515152 seems related:
'setxkbmap cz_qwerty' gets remapped to cz(qwerty), but 'setxkbmap us,cz_qwerty' doesn't.

Cheers,
Julien
Comment 9 Sergey V. Udaltsov 2009-04-22 08:13:12 UTC
Julien, does debian include compatibility rules (in the configure params)?
Comment 10 Julien Cristau 2009-04-22 08:26:13 UTC
> --- Comment #9 from Sergey V. Udaltsov <svu@gnome.org>  2009-04-22 08:13:12 PST ---
> Julien, does debian include compatibility rules (in the configure params)?

we don't explicitly disable compat_rules, so that should be enabled.
Comment 11 Sergey V. Udaltsov 2009-04-22 13:23:45 UTC
It seems there was a real bug in the compat rules processing. Could you please check from git?
Comment 12 Julien Cristau 2009-04-22 13:38:51 UTC
> --- Comment #11 from Sergey V. Udaltsov <svu@gnome.org>  2009-04-22 13:23:45 PST ---
> It seems there was a real bug in the compat rules processing. Could you please
> check from git?

looks good, thanks much!
Comment 13 Stefan Dirsch 2011-10-28 02:18:26 UTC
*** Bug 26088 has been marked as a duplicate of this bug. ***


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.