After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670607 - Wrong handling of variants
Wrong handling of variants
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Region & Language
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-22 13:05 UTC by drago01
Modified: 2012-02-22 19:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
region: Fix handling of variants in "Copy" button (4.75 KB, patch)
2012-02-22 18:12 UTC, Bastien Nocera
none Details | Review
region: Fix handling of variants in "Copy" button (4.75 KB, patch)
2012-02-22 18:30 UTC, Bastien Nocera
none Details | Review
region: Fix handling of variants in "Copy" button (4.66 KB, patch)
2012-02-22 19:40 UTC, Bastien Nocera
committed Details | Review

Description drago01 2012-02-22 13:05:52 UTC
The "Copy Settings" button in the region panel calls the "SetX11Keyboard" dbus method (implemented by systemd-localed) and passes everything as layout instead of properly distinct between layout and variant; resulting into a config file that X cannot parse:

-----
g_dbus_proxy_call (localed_proxy,
                           "SetX11Keyboard",
                           g_variant_new ("(ssssbb)", layout, "", "", "", TRUE,
TRUE),
                           G_DBUS_CALL_FLAGS_NONE,
                           -1, NULL, NULL, NULL);
-----

As specific example "de nodeadkeys" will get passed as layout while only "de" is the layout and "nodeadkeys" is the variant:

------
<method name="SetX11Keyboard">
    <arg name="layout" type="s" direction="in"/>
    <arg name="model" type="s" direction="in"/>
    <arg name="variant" type="s" direction="in"/>
    <arg name="options" type="s" direction="in"/>
    <arg name="convert" type="b" direction="in"/>
    <arg name="user_interaction" type="b" direction="in"/>
</method>
------

Quoting Peter's comment from the downstream bug:

-----------
In GNOME, go to the region and language panel, select a layout with a variant
(e.g. German, nodeadkeys). Go to the System panel, click on "Copy Settings".

This causes 00-system-setup-keyboard.conf to be linked to /dev/null and a new
file 00-keyboard.conf is put in place by systemd. That file has a configuration
that cannot be read by the X server.

        Option "XkbLayout" "at nodeadkeys"

Should instead be:
Option "XkbLayout" "at"
Option "XkbVariant" "nodeadkeys"

For multiple layouts, each value must be a comma-separated list. So if your
layouts are "us,at(nodeadkeys)", the two options must be

Option "XkbLayout" "us,at"
Option "XkbVariant" ",nodeadkeys"

Note the comma before nodeadkeys, otherwise it's assigned to the first layout
(and us(nodeadkeys) doesn't exist).
---------
Comment 1 Bastien Nocera 2012-02-22 18:12:43 UTC
Created attachment 208209 [details] [review]
region: Fix handling of variants in "Copy" button

Instead of splitting the list of layouts into layouts and variants,
we were expecting strings of the form:
layout1 variant1, layout2 variant2
to be handled automatically. We should instead create the lists
of layouts and variants separately before passing them to localed.
Comment 2 Bastien Nocera 2012-02-22 18:30:21 UTC
Created attachment 208211 [details] [review]
region: Fix handling of variants in "Copy" button

Instead of splitting the list of layouts into layouts and variants,
we were expecting strings of the form:
layout1 variant1, layout2 variant2
to be handled automatically. We should instead create the lists
of layouts and variants separately before passing them to localed.
Comment 3 Bastien Nocera 2012-02-22 19:40:52 UTC
Created attachment 208215 [details] [review]
region: Fix handling of variants in "Copy" button

Instead of splitting the list of layouts into layouts and variants,
we were expecting strings of the form:
layout1 variant1, layout2 variant2
to be handled automatically. We should instead create the lists
of layouts and variants separately before passing them to localed.
Comment 4 Bastien Nocera 2012-02-22 19:42:13 UTC
Works in my tests, please reopen if not.

Attachment 208215 [details] pushed as b55d07e - region: Fix handling of variants in "Copy" button