Invalid keyboard layouts pass through

  • Open
  • quality assurance status badge
2 participants
  • Brice Waegeneire via web
  • Ludovic Courtès
Submitted by
Ludovic Courtès

Debbugs page

Ludovic Courtès wrote on 5 Apr 2020 13:59
(address .

After a painful debugging session where I was blaming GDM for not using
the right keyboard layout, I found that I had specified an invalid
keyboard layout variant, as in:

(keyboard-layout "fr" "does-not-exist")

‘ckbcomp’ would build a layout for the console just fine, only with a
warning. Xorg would switch to the default “fr” layout (which exists)
and ignore the “does-not-exist” variant.

However, GNOME Shell would reject it in ‘keyboardManager.js’ because:

[found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id);

returns ‘found = false’ since ‘fr+does-not-exist’ is not found, and thus
goes on to use the US layout:

if (found)
return { layout: _layout, variant: _variant };
return { layout: DEFAULT_LAYOUT, variant: DEFAULT_VARIANT };

(This is just for GNOME Shell because again, Xorg itself installs the
“fr” layout, as can be seen if you start ratpoison or similar.)

Long story short: it would be great if invalid keyboard layouts were
caught when the system is instantiated. It could be ‘ckbcomp’ errorring
out, or we could have additional code that browses xkeyboard-config’s
‘base.xml’ file.

Ludovic Courtès wrote on 19 Sep 2020 01:41
control message for bug #40456
(address .
severity 40456 important
Brice Waegeneire via web wrote on 4 Mar 2021 09:01
Invalid keyboard layouts pass through
(address .
We could listen from the WARNING: string on stderr of ckbcomp, or that dirty pipeline return 1 with an incorrect variant « setxkbmap -print fr foo | xkbcomp - -C »
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to

To respond to this issue using the mumi CLI, first switch to it
mumi current 40456
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch