Bug 1002533 - simplify keymap management
Summary: simplify keymap management
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vratislav Podzimek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-29 12:03 UTC by Kamil Páral
Modified: 2013-09-19 02:41 UTC (History)
7 users (show)

Fixed In Version: anaconda-20.17-1.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-19 02:41:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
screenshot showing Region & Language restart button after keyboard and language are changed while installer is running (86.06 KB, image/png)
2013-08-30 12:05 UTC, Steve Tyler
no flags Details
screenshot showing KEYBOARD LAYOUT dialog with "es" in layout selector, but "English (English(US))" in the layout list (64.98 KB, image/png)
2013-08-30 15:40 UTC, Steve Tyler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 994180 0 unspecified CLOSED Boot-time LUKS passphrase input *always* defaults to en-us 2021-02-22 00:41:40 UTC

Internal Links: 994180

Description Kamil Páral 2013-08-29 12:03:08 UTC
Description of problem:
Installation from a LiveCD using a non-US keymap is _hard_. The person needs to configure his keymap in DE, and then another set of keymaps in anaconda (for the installed system). To realize all the required steps is hard for me, and I work with anaconda every day. It's a no-go for many general users.

I've played a bit today with Ubuntu installer, to see how they do it. They allow to change keymap in the installer, and it changes the keymap in the whole X session (equivalent to running setxkbmap). It is not tied to gnome control panel, which means gnome control dialogs or indicators (if you add them, by default they are not shown) display outdated information. The chosen layout is used for installation and in the installed system as the default one.

I spent some time discussing this approach with Vratislav Podzimek and other guys. Here's a proposal how to simplify things in Anaconda in Live session:

1. Language changed from Anaconda should affect the current keymap. If I use the Anaconda keymap indicator, or change the top-most entry in the keymap list, or use keyboard shortcut to change keymaps, it should really change the keymap (like setxkbmap).
2. Use the same keymap spoke for DVD and Live. That means the "test your keyboard" box can be un-grayed again in the keymap spoke. The ugly ugly instructions how to change keymap can be erased. (The instructions should still note that this spoke shows which keymaps will be available in the installed system and that the user should make sure that he provides the password using the same keymap as used by the installed system).
3. In the rare case where the user changed his keymap prior to running Anaconda, and then selected a different language/keymap in the initial screen, show a warning triangle over the keymap spoke. That will force the user to enter the spoke and confirm his choices, or adjust the settings.

This proposal means removing a lot of if-blocks, thus cleaning the code, and it also provides a better experience for the user - the installation language can be configured inside the installed -> beautiful.

There are some corner cases if the user pre-configures different keymaps in the system before running Anaconda (most of them are just cosmetic), but overall this provides a much better and simpler experience for the majority of users.


Version-Release number of selected component (if applicable):
anaconda 20.8

Comment 1 Steve Tyler 2013-08-29 18:56:49 UTC
(In reply to Kamil Páral from comment #0)
...
> 3. In the rare case where the user changed his keymap prior to running
> Anaconda, and then selected a different language/keymap in the initial
> screen, show a warning triangle over the keymap spoke. That will force the
> user to enter the spoke and confirm his choices, or adjust the settings.
...

+1 on your proposal. Thanks for your suggestions.

The installer can use systemd to query and set the locale settings (including the keymap). Settings in the desktop session can be obtained from systemd-localed[1] (equivalent to running the "localectl" command).

The only issue I see is that, in the Live environment, if the installer has already started, the user could change the locale settings in the desktop session. systemd supports client notifications[2], so, in principle, the installer could update itself, but at some point the installer has to know what the actual intended configuration is. That would presumably be when the user clicks Begin Installation.

Displaying a locale-configuration-changed icon is a good idea. That is similar to what is already done for the Software Selection when the user changes the Installation Source on the DVD.

[1] The localed API is documented here:
http://www.freedesktop.org/wiki/Software/systemd/localed/

[2] "Whenever the system locale or keymap is changed via the daemon PropertyChanged signals are sent out to which clients can subscribe."

Comment 2 Steve Tyler 2013-08-29 19:22:40 UTC
Well there is another issue. On the Live image, if the user changes the language from Gnome Control Center (Settings:Region & Language), the user is prompted to restart the desktop session. If the installer is already running, restarting the desktop session would terminate the installer, because restarting the desktop session terminates any processes running in the desktop session.

Comment 3 Kamil Páral 2013-08-30 09:46:09 UTC
(In reply to Steve Tyler from comment #2)
> Well there is another issue. On the Live image, if the user changes the
> language from Gnome Control Center (Settings:Region & Language),

We're talking about keymaps here, not languages. When you change the keymap in gnome control center, you are not requested to relogin.

But you're right that user is free to close anaconda or quit the session during installation. He should at least confirm that action, so that he doesn't do that with a simple misclick. That's bug 864470.

Comment 4 Steve Tyler 2013-08-30 11:22:51 UTC
Prompting the user before terminating the installer is definitely a good idea, since the Region & Language dialog is not part of the installer, it is not apparent that changes made in the R&L dialog would have any influence on what the installer does or does not do. The issue is that the user is likely to configure _both_ the language and the keymap at the same time.

The need to restart the desktop session after changing the language appears to be a design defect -- the desktop should be able to reconfigure itself after a language change. The installer should be able to do the same, of course ...

Comment 5 Kamil Páral 2013-08-30 11:27:18 UTC
The core idea of this proposal is that the user doesn't need to visit gnome control center at all, not even know about it.

Comment 6 Steve Tyler 2013-08-30 11:43:39 UTC
OK, so what happens if the installer is running, and the user changes the keyboard settings from Gnome Control Center?

Comment 7 Steve Tyler 2013-08-30 12:05:26 UTC
Created attachment 792140 [details]
screenshot showing Region & Language restart button after keyboard and language are changed while installer is running

Comment 8 Steve Tyler 2013-08-30 12:13:39 UTC
This is better than I thought. The user does not need to restart after changing the language. I clicked the close icon next to the restart button, and then closed R&L. systemd has the expected settings:

$ localectl
   System Locale: LANG=es_ES.utf8
                  LC_NUMERIC=en_US.UTF-8
                  LC_TIME=en_US.UTF-8
                  LC_MONETARY=en_US.UTF-8
                  LC_PAPER=en_US.UTF-8
                  LC_MEASUREMENT=en_US.UTF-8
       VC Keymap: es
      X11 Layout: es

Comment 9 Kamil Páral 2013-08-30 13:48:23 UTC
Steve, please stop confusing this report(!). This is not about language, this is about keymap. Language is configured in anaconda in the initial screen and there are no influences between anaconda language and system language.

> OK, so what happens if the installer is running, and the user changes the
> keyboard settings from Gnome Control Center?
The same as always, the keymap gets switched. That always worked and there's no change in behavior. This proposal says that you should also be able to switch the keymap from Anaconda. It won't be reflected in the gnome indicator (which is hidden by default), unless we add DE-specific code, but at least it will _work_.

Comment 10 Steve Tyler 2013-08-30 15:13:38 UTC
In the attached screenshot, the installer shows "es" in the upper right corner, and "English (English (US))" under KEYBOARD.

I am confused, which one is correct?

Comment 11 Kamil Páral 2013-08-30 15:31:58 UTC
I've already responded to this in comment 9 and in comment 0. Things will never be in perfect sync unless anaconda adds a ton of DE-specific code for every DE out there. This proposal intends to improve the situation with just a few simple adjustments (80-20 principle).

You complain about things that I specifically listed as _not being covered_. So if you want those missing 20% fixed so badly, and you want anaconda devs to spend a lot of time on it, can you please file a separate report asking for full GNOME integration and stop obfuscating this _intentionally_ very simple proposal? Thank you.

Comment 12 Steve Tyler 2013-08-30 15:40:09 UTC
Created attachment 792225 [details]
screenshot showing KEYBOARD LAYOUT dialog with "es" in layout selector, but "English (English(US))" in the layout list

I configured "es" from Gnome Control Center, but Spanish is not in the layout list.

I am confused ...

BTW, I sometimes forget what those little letters mean:
Is "es" Spanish, or is it Estonian?

I am confused ...

Tested with:
$ qemu-kvm -m 4096 -hda f20-test-3.img -cdrom ~/xfr/fedora/F20/Alpha/Fedora-Live-Desktop-x86_64-20-Alpha-TC2-1.iso -vga std -boot menu=on

Comment 13 Steve Tyler 2013-08-30 15:53:53 UTC
(In reply to Kamil Páral from comment #11)
> ... Things will
> never be in perfect sync unless anaconda adds a ton of DE-specific code for
> every DE out there. ...

systemd-localed is the common element that enables integration. The DE is irrelevant, if it is using systemd-localed. Of course, I could be confused ...

And I now see that the installer is already using systemd-localed. That's excellent:

$ less -N anaconda-20.9-1/pyanaconda/keyboard.py
...
    642 class LocaledWrapper(object):
    643     """
    644     Class wrapping systemd-localed daemon functionality. By using safe_dbus
    645     module it tries to prevent failures related to threads and main loops.
    646 
    647     """
...

Comment 14 Vratislav Podzimek 2013-09-05 12:01:46 UTC
Patch that implements what was suggested in the comment #0 sent to anaconda-patches [1]

[1] https://lists.fedorahosted.org/pipermail/anaconda-patches/2013-September/005699.html

Comment 15 Vratislav Podzimek 2013-09-05 12:04:30 UTC
(In reply to Steve Tyler from comment #13)
> (In reply to Kamil Páral from comment #11)
> > ... Things will
> > never be in perfect sync unless anaconda adds a ton of DE-specific code for
> > every DE out there. ...
> 
> systemd-localed is the common element that enables integration. The DE is
> irrelevant, if it is using systemd-localed. Of course, I could be confused
> ...
That would rely on all DE's using systemd-localed for storing current user's configuration as the system-wide configuration which is nonsense.

Comment 16 Steve Tyler 2013-09-05 12:22:00 UTC
Isn't systemd a standard component of Fedora?
DE's that do not use systemd need to be upgraded to use systemd.
That makes sense to me, anyway ...

Comment 17 Fedora Update System 2013-09-06 22:43:04 UTC
anaconda-20.12-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/anaconda-20.12-1.fc20

Comment 18 Fedora Update System 2013-09-07 17:03:41 UTC
Package anaconda-20.12-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing anaconda-20.12-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-16040/anaconda-20.12-1.fc20
then log in and leave karma (feedback).

Comment 19 Kamil Páral 2013-09-09 09:23:53 UTC
With F20 Alpha TC5 Live, keymap selection works great in Anaconda. Thanks. The current keymap can be changed, the input box can be used to test the keys.

This doesn't work, however:
"3. In the rare case where the user changed his keymap prior to running Anaconda, and then selected a different language/keymap in the initial screen, show a warning triangle over the keymap spoke. That will force the user to enter the spoke and confirm his choices, or adjust the settings."

I used gnome settings to add Czech and English layouts and kept Czech active while starting Anaconda. On the initial language screen, Czech was active and displayed in the anaconda indicator. I picked English as the installation language, and after proceeding to the main hub, the anaconda indicator was switch to "us" and only English is present in they keymap spoke. The spoke doesn't have a warning icon and I can't switch the keymaps using anaconda indicator (only "us" is present).

Actually, I think this behavior is fine as well. It's very visible that English is active and anaconda allows to add keymaps and switch between them. The only drawback is that gnome keymap indicator might not be in sync with anaconda indicator, but there's not much we can do about it. And after thinking about it, there are some hard design choices when implementing the suggestion above anyway.

I'd say thanks, keep it this way. We will see what users are going to say about this (some of them might be initially confused, because they might be used to pre-configure the keymap before running anaconda, due to previous restrictions).

Comment 20 Fedora Update System 2013-09-10 00:11:46 UTC
anaconda-20.13-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/anaconda-20.13-1.fc20

Comment 21 Fedora Update System 2013-09-10 19:49:05 UTC
anaconda-20.14-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/anaconda-20.14-1.fc20

Comment 22 Fedora Update System 2013-09-12 01:04:03 UTC
anaconda-20.15-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/anaconda-20.15-1.fc20

Comment 23 Fedora Update System 2013-09-14 01:05:47 UTC
anaconda-20.16-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/anaconda-20.16-1.fc20

Comment 24 Fedora Update System 2013-09-16 17:48:55 UTC
anaconda-20.17-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/anaconda-20.17-1.fc20

Comment 25 Fedora Update System 2013-09-19 02:41:45 UTC
anaconda-20.17-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.