Error activating XKB configuration with MacBook keyboard model

Bug #327963 reported by Martin von Gagern
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Mactel Support
New
Undecided
Unassigned
xkeyboard-config
Unknown
Medium
xkeyboard-config (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: xkb-data

I've got Intrepid installed on a MacBookPro5,1 with German keyboard layout. I started configuring the keyboads using gnome-keyboard-properties as available from the settings menu. I first selected the layout "Germany Macintosh, eliminate dead keys" and followed that up with changing the model to "MacBook/MacBook Pro (Intl)". This resulted in an error message "Error activating XKB configuration" which asked me to prvide this additional information:

$ xprop -root | grep XKB
_XKB_RULES_NAMES_BACKUP(STRING) = "evdev", "pc105", "de", "mac_nodeadkeys", ""
_XKB_RULES_NAMES(STRING) = "evdev", "pc105", "de", "mac_nodeadkeys", ""

$ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd
 layouts = []
 model = macbook79
 options = []

As the error message from the dialog contains little actual information, I straced gnome-settings-daemon and identified a failing invocation of xkbcomp as the likely cause of the issue. By renaming /usr/bin/xkbcomp and replacing it with a wrapper script, I managed to get my hands on its input file and reproduce the issue:

$ cat /tmp/fileJPMGgA
xkb_keymap {
        xkb_keycodes { include "evdev+aliases(qwertz)" };
        xkb_types { include "complete+numpad(mac)" };
        xkb_compat { include "complete" };
        xkb_symbols { include "pc+macintosh_vndr/de(mac_nodeadkeys)+inet(evdev)" };
        xkb_geometry { include "macintosh(macbook79)" };
};

$ xkbcomp -I -I/usr/share/X11/xkb -xkm /tmp/fileJPMGgA /tmp/fileNtKqh7
Error: No Symbols named "mac_nodeadkeys" in the include file "macintosh_vndr/de"
                  Exiting
                  Abandoning symbols file "(null)"

That looks like a much better error description. Looking at /usr/share/X11/xkb/symbols/macintosh_vndr/de I see that indeed it doesn't contain a description of "mac_nodeadkeys". Neither does it include /usr/share/X11/xkb/symbols/de where the mac_nodeadkeys would have been defined. Changing the layout to simple "Germany Eliminate dead keys", I could use the MacBook keyboard model all right, just as mac_nodeadkeys layout worked all right with a Generic keyboard model. However, both combinations don't fully match the key labels.

My first concern is that for an obvious choice like a MacBook keyboard model with a mac keyboard layout, no obscure error messages should be generated by the Gnome UI. Secondly, it would be nice to actually get Mac keyboard layout, in order to stay consistent with OS X and friends.

Tags: intrepid
Revision history for this message
Martin von Gagern (gagern) wrote :
Revision history for this message
Martin von Gagern (gagern) wrote :

> both combinations don't fully match the key labels.

I guess I'll take that back. Having the left Alt key perform as AltGr as it does in Mac OS X doesn't seem to make too much sense, as many applications expect the existence of an Alt/Meta key to invoke commands. The right Alt key works as AltGr and allows access to all those special symbols in the same location where OS X has them. Therefore, simply extending the definition to make macintosh_vndr/de(mac_nodeadkeys) an alias for macintosh_vndr/de(nodeadkeys) might be enough to avoid the error and yield reasonable results. That should be easy.

Revision history for this message
Bryce Harrington (bryce) wrote :

Getting a better error message for the Gnome UI is a GNOME issue obviously, not xkeyboard-config's duty, and really ought to be filed separately against the appropriate GNOME component. As to the secondary bug of the error activating XKB, that's a well known issue so will dupe to that. Undupe (and clarify) if you'd like something differently done.

Revision history for this message
Martin von Gagern (gagern) wrote :

> Getting a better error message for the Gnome UI is a GNOME issue obviously, not xkeyboard-config's duty, and really ought to be filed separately against the appropriate GNOME component.

I agree, just filed bug #328980 for this. It's a bit tricky, as it involves multiple packages.

> As to the secondary bug of the error activating XKB, that's a well known issue so will dupe to that. Undupe (and clarify) if you'd like something differently done.

I had bug #67188 considered before filing mine, but the mention of editing xorg.conf in the headline didn't seem to apply to me at all, so I filed a new one. Now that I've read all the comments in #67188, I get the feeling that it is a large collection of bugs with quite different reasons, but all looking the same due to missing error messages. Some, like bug #67188 comment #38, are the same as this one here, while others have different causes, for which I don't know the reason. For lack of information, I expect #67188 to remain open for quite a long time.

In contrast to this, the scope of what I request for here is much clearer, and a fix is possible. Therefore I'd undupe and ask that you
 1. make macintosh_vndr/de(mac_nodeadkeys) an alias for macintosh_vndr/de(nodeadkeys)
 2. Do the same for the deadkeys variant
 3. Do the same for languages other than "de" with similar configuration
The attached patch tries to follow this approach. I grepped fro '"mac' in symbols/* and then made sure the same variants were included as aliases in symbols/macintosh_vndr/*. Not tested yet.

You might, on the other hand, be of the opinion that having different names for the same symbols is not the way to go, and that instead of providing these aliases at the xkb-data level, the user interface should prevent the user from selecting such combinations. In that case, another bug for the Gnome control-center would be in order, while you might mark this as invalid for xkeyboard-config.

Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks for clarifying the requests. I think we can approach upstream for guidance on those items.

Changed in xkeyboard-config:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Dedy Hariyadi (milisdad) wrote :

report in macbook 2.1 :

$ xprop -root | grep XKB
_XKB_RULES_NAMES_BACKUP(STRING) = "evdev", "macbook79", "us", "mac", "lv3:ralt_switch"
_XKB_RULES_NAMES(STRING) = "evdev", "macbook79", "us", "mac", "lv3:ralt_switch"

$ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd
 layouts = [us mac]
 options = [lv3 lv3:ralt_switch,grp grp:alts_toggle]
 model =

Revision history for this message
Hicks (hicks1gb) wrote :

Report in MacBook Pro 15 inch intel, Ubuntu Jaunty.

Error activating XKB configuration.
It can happen under various circumstances:
- a bug in libxklavier library
- a bug in X server (xkbcomp, xmodmap utilities)
- X server with incompatible libxkbfile implementation

X server version data:
The X.Org Foundation
10600000

If you report this situation as a bug, please include:
- The result of xprop -root | grep XKB
- The result of gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd

000000000000000000000000000000000000000000000000000000000000000000000000

predator@MacBook:~$ xprop -root | grep XKB
_XKB_RULES_NAMES_BACKUP(STRING) = "evdev", "macbook79", "es", "mac", "lv3:win_switch,lv3:lwin_switch,lv3:rwin_switch"
_XKB_RULES_NAMES(STRING) = "evdev", "macbook79", "es", "mac", "lv3:win_switch,lv3:lwin_switch,lv3:rwin_switch"
predator@MacBook:~$ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd
 layouts = []
 options = [lv3 lv3:lwin_switch,lv3 lv3:rwin_switch]
 model = macbook79
predator@MacBook:~$

Bryce Harrington (bryce)
tags: added: intrepid
Revision history for this message
Martin von Gagern (gagern) wrote :

Bryce, did you approach upsream, as your comment 5 indicates? What's current status there? Do you have a URL for a bug report, mailing list thread or similar? Recent comments on bug #67188 indicate that there is still a lot of confustion caused by this bug here, so a fix would be great, maybe even without consent from upstream, if need be.

Revision history for this message
In , Bryce Harrington (bryce) wrote :

Created an attachment (id=30308)
Add aliases for mac layouts

Forwarding this patch from Ubuntu reporter Martin von Gagern:
https://bugs.edge.launchpad.net/ubuntu/+source/xkeyboard-config/+bug/327963

Please:

 1. make macintosh_vndr/de(mac_nodeadkeys) an alias for macintosh_vndr/de(nodeadkeys)
 2. Do the same for the deadkeys variant
 3. Do the same for languages other than "de" with similar configuration
The attached patch tries to follow this approach. I grepped fro '"mac' in symbols/* and then made sure the same variants were included as aliases in symbols/macintosh_vndr/*. Not tested yet.

You might, on the other hand, be of the opinion that having different names for the same symbols is not the way to go, and that instead of providing these aliases at the xkb-data level, the user interface should prevent the user from selecting such combinations. In that case, another bug for the Gnome control-center would be in order, while you might mark this as invalid for xkeyboard-config.

Revision history for this message
In , Bryce Harrington (bryce) wrote :

Btw, here's the original bug report:

I've got Intrepid installed on a MacBookPro5,1 with German keyboard layout. I started configuring the keyboads using gnome-keyboard-properties as available from the settings menu. I first selected the layout "Germany Macintosh, eliminate dead keys" and followed that up with changing the model to "MacBook/MacBook Pro (Intl)". This resulted in an error message "Error activating XKB configuration" which asked me to prvide this additional information:

$ xprop -root | grep XKB
_XKB_RULES_NAMES_BACKUP(STRING) = "evdev", "pc105", "de", "mac_nodeadkeys", ""
_XKB_RULES_NAMES(STRING) = "evdev", "pc105", "de", "mac_nodeadkeys", ""

$ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd
 layouts = []
 model = macbook79
 options = []

As the error message from the dialog contains little actual information, I straced gnome-settings-daemon and identified a failing invocation of xkbcomp as the likely cause of the issue. By renaming /usr/bin/xkbcomp and replacing it with a wrapper script, I managed to get my hands on its input file and reproduce the issue:

$ cat /tmp/fileJPMGgA
xkb_keymap {
        xkb_keycodes { include "evdev+aliases(qwertz)" };
        xkb_types { include "complete+numpad(mac)" };
        xkb_compat { include "complete" };
        xkb_symbols { include "pc+macintosh_vndr/de(mac_nodeadkeys)+inet(evdev)" };
        xkb_geometry { include "macintosh(macbook79)" };
};

$ xkbcomp -I -I/usr/share/X11/xkb -xkm /tmp/fileJPMGgA /tmp/fileNtKqh7
Error: No Symbols named "mac_nodeadkeys" in the include file "macintosh_vndr/de"
                  Exiting
                  Abandoning symbols file "(null)"

That looks like a much better error description. Looking at /usr/share/X11/xkb/symbols/macintosh_vndr/de I see that indeed it doesn't contain a description of "mac_nodeadkeys". Neither does it include /usr/share/X11/xkb/symbols/de where the mac_nodeadkeys would have been defined. Changing the layout to simple "Germany Eliminate dead keys", I could use the MacBook keyboard model all right, just as mac_nodeadkeys layout worked all right with a Generic keyboard model. However, both combinations don't fully match the key labels.

My first concern is that for an obvious choice like a MacBook keyboard model with a mac keyboard layout, no obscure error messages should be generated by the Gnome UI. Secondly, it would be nice to actually get Mac keyboard layout, in order to stay consistent with OS X and friends.

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

That's tough one.

First of all, these days macs have usual PC kbds. Would it make sense to drop the rules referring to macintosh_vndr/* symbols? If necessary, variants could be added to the 'general' symbol files.

What I will try to do is analyze the difference between macintosh_vndr/* symbols and normal symbols.

BTW, I immediately see that 'es' can be dropped - it only includes general default 'es' variant;)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xkeyboard-config - 1.6-1ubuntu3

---------------
xkeyboard-config (1.6-1ubuntu3) karmic; urgency=low

  * Add 101_rus.patch: Tag USA Russian Phonetic keyboard layout with
    Russian language tag.
    (LP: #429034)
  * Add 102_mac_aliases.patch: Fix error activating XKB config on MacBook
    due to lack of mac w/ deadkeys layout aliases.
    (LP: #327963)

 -- Bryce Harrington <email address hidden> Mon, 12 Oct 2009 15:27:33 -0700

Changed in xkeyboard-config (Ubuntu):
status: Triaged → Fix Released
Changed in xkeyboard-config:
status: Unknown → Confirmed
Revision history for this message
The Loeki (the-loeki) wrote :

I was having the exact same issue, but then with a Macbook 79 model keyboard (Macbook/Pro Intl) and the US International with AltGr dead keys.

One of the commenters in the FreeDesktop bug correctly notes that there might actually be little use for these symbols anymore, but since I'm not exactly an XKB guru I find it too hard to tell.

Anway, I added
partial alphanumeric_keys
xkb_symbols "altgr-intl"{
    include "us(altgr-intl)"
};

to /usr/share/X11/xkb/symbols/macintosh_vndr/us and the error went away. Everything works as it should AFAICT.

Revision history for this message
NicoInattendu (nico-inattendu) wrote :

I have the same issue on imac 24on karmic , with setting up a french keyboard.
The problem apperas on karmic, noi problem on jaunty
About comment #9 : I do not have any package xkeyboard-config in the sources on karmic , the closest one seems xkb-data. Is normal that this package wasn't available under karmic ?

Revision history for this message
Martin von Gagern (gagern) wrote : Re: [Bug 327963] Re: Error activating XKB configuration with MacBook keyboard model

NicoInattendu wrote:
> I have the same issue on imac 24on karmic , with setting up a french keyboard.
> The problem apperas on karmic, noi problem on jaunty

Seems to be a bug in my fix: The french layout only has layout variants
"extended" and "nodeadkeys", not "basic", and as I defined "mac" to be
an alias for "basic", that fails:

Error: No Symbols named "basic" in the include file "macintosh_vndr/fr"
       Exiting
       Abandoning symbols file "mac"
       Abandoning symbols file "(null)"

> About comment #9 : I do not have any package xkeyboard-config in the sources on karmic , the closest one seems xkb-data. Is normal that this package wasn't available under karmic ?

xkeyboard-config is the name of a source package, i.e. a package from
which the ubuntu developers build the binary packages you install.
According to http://packages.ubuntu.com/source/karmic/xkeyboard-config
the only binary package built from xkeyboard-config is xkb-data. So
that's all right.

Changed in xkeyboard-config:
importance: Unknown → Medium
Changed in xkeyboard-config:
importance: Medium → Unknown
Revision history for this message
Bryce Harrington (bryce) wrote :

I'm disabling the patch in xkeyboard-config natty; based on the last couple comments it sounds like this might cause secondary issues, and upstream did not take the patch as it appears to have not been a full fix.

Changed in xkeyboard-config (Ubuntu):
status: Fix Released → Confirmed
Changed in xkeyboard-config:
importance: Unknown → Medium
Revision history for this message
Nadim Khoury (nadim-gs-khoury) wrote :

I got this error on my Mac 2.1 after upgrading from 10.10 to 11.04 today.
If any data is needed, let me know.

Revision history for this message
Michael Foord (mfoord) wrote :

I'm seeing this with 11.04 on a UK MacbookAir (2011).

Revision history for this message
Eric B (ebischoff) wrote :

Again, a regression when moving from 11.10 to 12.04 (precise pangolin).

The attached patch solves the problem, as usual.

Revision history for this message
In , Gitlab-migration (gitlab-migration) wrote :

-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/issues/112.

Changed in xkeyboard-config:
status: Confirmed → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.