[LightDM] On keyboard layouts
Christian Seiler
christian at iwakd.de
Fri Feb 7 04:49:45 PST 2014
Hi,
I've just pushed a merge request for updating the Qt bindings so that
they also understand the keyboard layout business:
https://code.launchpad.net/~christian-w/lightdm/qt-binding-keyboard-layouts/+merge/205356
However, while experimenting with that, I've made a couple of
interesting observations:
1. All greeters I've looked at (Gtk, unmaintained Qt, KDE, Razor-QT,
Unity) don't seem to implement this at all... Ok, the Qt-based greeters
are no surprise. But for Gtk/Unity: I see some references to old bug
reports online if I search for this, but they reference C code, whereas
the Unity greeter is now written completely in Vala. (At least current
bzr trunk.) And ok, Vala is compiled to C, but the Vala code I looked
at contains nothing that I could find that contains anything resembling
keyboard layouts.
Am I missing something here? Currently, it appears to me that nobody is
actually using that code. Nevertheless, I've seen screenshots of the
Unity greeter with a keyboard symbol, is that perhaps an old version?
2. I get a huge list of layouts from the backend, it appears to me that
those are all layouts that are installed on my system. (472 entries) If
I want to use that for writing some kind of layout switcher for a
greeter, I don't see how that could be made usable in a reasonable way.
The only greeter outside of lightdm of which I know that it supports
layouts is gdm3, and that uses the current XkbLayouts X setting to
restrict the available layouts to those, making it much easier for a
system administrator to choose a sane policy of available layouts.
3. The gobject API exposes three properties for keyboard layouts: name,
short description and description. From reading the API, this seems
perfectly reasonable, but looking at the data the contents seems
*really* weird:
- Description is fine, that is something like 'English (US)' or
'Berber (Morocco, Tifinagh extended)'.
- Short description ist empty *most* of the time, but sometimes it
contains a ISO 639-2 (or -3?) language code, but *only* on a
minority of the layouts. (Ok, can probably live with that, but the
name 'short description' is misleading IMHO.)
- Then we come to name, which is the really weird part. For the most
basic layouts, name is simply the X layout code like 'us', 'de',
'at', 'fr', etc. However, if there is a variant (no dead keys, euro
sign, etc.), then the name field consists of name "\t" variant, so
for example for the Belgian ISO alternative layout, name is equal
to "be\tiso-alternative".
Funny thing is, the API itself works fine, getting the current layout
and then switching to something else is not a problem.
Regards,
Christian
More information about the LightDM
mailing list