[rant] keeping policy in HAL
Alexander E. Patrakov
patrakov at gmail.com
Sun Nov 30 22:38:21 PST 2008
Peter Hutterer wrote:
> I was referring to DE as a concept, not as a specific implementation. It
> counts as part of whatever you're running afterwards, may be gnome, kde,
> xfce or my-happy-bunch-of-shellscripts.
OK. Anyway, my point about XDM as the example implementation not
following the modern guidelines was moot, because, as Daniel Stone said,
XDM is no longer in the standard Xorg distribution.
>> Also, currently, for unconfigured Xorg, such newly-added keyboard gets
>> the "us" layout. This is also a hard-coded policy, should we remove it?
>> In fact, I would consider any default other than "completely unusable
>> keyboard that doesn't produce any events" a policy. Reason: I want US
>> developers eat their own dogfood.
> Well, if you don't map your keycodes to something, you won't be able to type
Yes, that's the point. This will force the maintainers of Linux
distributions with US origin (to Daniel Stone: they are obviously not
the same people as the input maintainers in Xorg) to do "the right
thing" for everyone, instead of just not noticing the problem because
non-US users think that the keyboard is obviously broken beyond repair
(and thus not reporting the obvious bug).
> "us" is traditionally the default and I'll let others have a
> flamewar about that.
It is traditionally the default only in Xorg. If you get a Russian
version of Windows 2000 or XP, Russian will be the default, with the
possibility to switch to English with Alt+Shift. Also, even in the US
version, the keyboard layout is asked for during the installation, and
this becomes the default for all new keyboards.
I.e.: Windows has a useful notion of the global default keyboard layout,
and stores it in the registry. Xorg gets this from xorg.conf (that is
going to disappear from modern setups), HAL (not a good place for
policy), runtime configuration (excellent idea, but with no existing
clients usable from, say, Slim), falling back to "us" (and often distro
maintainers don't notice this).
>>> setxkbmap won't be able to set the layouts for future devices.
>> Then something is bad. Suppose that, due to EMI, the kernel decided to
>> disconnect and reconnect the USB keyboard after setxkbmap has set the
>> layout for it. Who will reset the layout for it? XDM currently can't run
>> programs in response to such events. Should I report this as a bug?
> Then you need a client in the background notifying you that a new device was
> added, either prompting you to update the keymap, or runs it directly.
Then it may be a good idea to write such client (even without the
pop-up, a static default stored in the configuration file will also
work) and add it to xorg-apps as an example implementation of such service.
Alexander E. Patrakov
More information about the xorg