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 721006 - Some XKB layouts are not needed in gnome-control-center region
Some XKB layouts are not needed in gnome-control-center region
Status: RESOLVED NOTGNOME
Product: gnome-control-center
Classification: Core
Component: Region & Language
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-12-24 07:15 UTC by Takao Fujiwara
Modified: 2018-02-02 09:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for cc-input-chooser.c (1.47 KB, patch)
2013-12-24 07:28 UTC, Takao Fujiwara
needs-work Details | Review

Description Takao Fujiwara 2013-12-24 07:15:22 UTC
When open gnome-control-center region and click '+' button to add new sources, some Chinese(China) sources are listed, e.g. Chinese(pinyin), Chinese(cangjie (m17n)), and it also shows 'cn' XKB layout as Chinese.
Users expect to be able to type Chinese with 'cn' but actually 'cn' is ASCII layout so they are confused.
Since most Chinese users can use 'us' layout, it would be good to remove 'cn' in gnome-control-center.

Also the special 'nec_vndr/jp' layout is minor and could be removed.
Comment 1 Takao Fujiwara 2013-12-24 07:15:48 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=885997
Comment 2 Takao Fujiwara 2013-12-24 07:28:41 UTC
Created attachment 264829 [details] [review]
Patch for cc-input-chooser.c
Comment 3 Georges Basile Stavracas Neto 2018-01-26 23:50:53 UTC
Review of attachment 264829 [details] [review]:

Is this patch relevant still?

Also, I'm not sure I understood the reasoning behind it yet.
Comment 4 Bastien Nocera 2018-01-30 10:36:30 UTC
Review of attachment 264829 [details] [review]:

> Is this patch relevant still?

Yes.

> Also, I'm not sure I understood the reasoning behind it yet.

We don't want to show a Chinese keyboard layout because it's useless (it's an ASCII keyboard layout, which can't type Chinese characters). Users would use an input method instead.

::: panels/region/cc-input-chooser.c
@@ +821,3 @@
 
+      if (g_str_equal (type, INPUT_SOURCE_TYPE_XKB))
+        for (i = 0; xkb_layout_blacklist[i]; i++)

Use g_strv_contains() instead.

@@ +836,3 @@
         }
+
+next_table_rows_by_id:

This is pretty ugly, I'd rather the while() loop was transformed into a for() loop to avoid this construct.
Comment 5 Takao Fujiwara 2018-01-30 13:50:34 UTC
Now I think it's better to move entries from /usr/share/X11/xkb/rules/evdev.xml to /usr/share/X11/xkb/rules/evdev.extras.xml than the black list.
So probably we will take another approach.

--- /usr/share/X11/xkb/rules/evdev.xml.orig	
+++ /usr/share/X11/xkb/rules/evdev.xml
@@ -2301,9 +2301,6 @@
         
         <shortDescription>zh</shortDescription>
         <description>Chinese</description>
-        <languageList>
-          <iso639Id>chi</iso639Id>
-        </languageList>
       </configItem>
       <variantList>
         <variant>
--- /usr/share/X11/xkb/rules/evdev.extras.xml.orig	
+++ /usr/share/X11/xkb/rules/evdev.extras.xml
@@ -1360,6 +1360,16 @@
         </variant>
       </variantList>
     </layout>
+    <layout>
+      <configItem>
+        <name>cn</name>
+        <shortDescription>zh</shortDescription>
+        <description>Chinese</description>
+        <languageList>
+          <iso639Id>chi</iso639Id>
+        </languageList>
+      </configItem>
+    </layout>
   </layoutList>
   <optionList>
       <group allowMultipleSelection="true">
Comment 6 Bastien Nocera 2018-01-30 14:47:21 UTC
(In reply to Takao Fujiwara from comment #5)
> Now I think it's better to move entries from
> /usr/share/X11/xkb/rules/evdev.xml to
> /usr/share/X11/xkb/rules/evdev.extras.xml than the black list.
> So probably we will take another approach.

Do you want to file an fd.o bug about that? And we'll close this one.
Comment 7 Takao Fujiwara 2018-02-02 08:37:48 UTC
Filed the patch and got several replies:
https://bugs.freedesktop.org/show_bug.cgi?id=104868