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 685457 - keyboard: Add likely IBus engine for some locales if empty setting
keyboard: Add likely IBus engine for some locales if empty setting
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: keyboard
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: 685458
 
 
Reported: 2012-10-04 02:06 UTC by Rui Matos
Modified: 2012-10-12 05:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keyboard: Slight refactoring for upcoming changes (1.73 KB, patch)
2012-10-04 02:06 UTC, Rui Matos
accepted-commit_now Details | Review
keyboard: Add likely IBus engine for some locales if empty setting (3.92 KB, patch)
2012-10-04 02:06 UTC, Rui Matos
none Details | Review
keyboard: Add likely IBus engine for some locales if empty setting (3.96 KB, patch)
2012-10-04 02:29 UTC, Rui Matos
needs-work Details | Review
keyboard: Slight refactoring for upcoming changes (1.72 KB, patch)
2012-10-04 14:40 UTC, Rui Matos
committed Details | Review
keyboard: Add likely IBus engine for some locales if empty setting (3.31 KB, patch)
2012-10-04 14:48 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2012-10-04 02:06:01 UTC
Patch attached.
Comment 1 Rui Matos 2012-10-04 02:06:03 UTC
Created attachment 225734 [details] [review]
keyboard: Slight refactoring for upcoming changes

We're going to add some special handling that doesn't apply when
running under GDM so return early if that's the case.
Comment 2 Rui Matos 2012-10-04 02:06:06 UTC
Created attachment 225735 [details] [review]
keyboard: Add likely IBus engine for some locales if empty setting

If there are no input sources configured and we're running under one
of some specific locales where it's highly likely that the user will
need/want a specific IBus source to type we just add it to the list.

LC_CTYPE is used to determine the locale for this purpose since many
users in these locales set LC_MESSAGES to English.
Comment 3 Rui Matos 2012-10-04 02:29:36 UTC
Created attachment 225737 [details] [review]
keyboard: Add likely IBus engine for some locales if empty setting

--
Added zh_TW → chewing
Comment 4 Daiki Ueno 2012-10-04 02:45:19 UTC
Can't the locale_engine list be unified with the supported_engines list in g-c-c somehow?  I expect that they will soon have several duplicates and maintaining them in two places would be cumbersome.
Comment 5 Takao Fujiwara 2012-10-04 05:07:03 UTC
I also think the initial trigger key is Ctrl+space for CJKI users.
Comment 6 Bastien Nocera 2012-10-04 11:21:59 UTC
Review of attachment 225734 [details] [review]:

++

::: plugins/keyboard/gsd-keyboard-manager.c
@@ +1318,2 @@
+        sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
+        if (g_variant_n_children (sources) < 1) {

No curlies here.
Comment 7 Bastien Nocera 2012-10-04 11:24:30 UTC
Review of attachment 225737 [details] [review]:

::: plugins/keyboard/gsd-keyboard-manager.c
@@ +520,3 @@
+                { "zh_CN", "pinyin" },
+                { "zh_HK", "cangjie3" },
+                { "zh_TW", "chewing" },

Are those really all the locales we can handle?
Can you add a reference to where you found this magic?

@@ +1346,2 @@
 static void
+init_builder_with_sources (GVariantBuilder *builder,

Move this up so you don't need to declare it. And is it used when building without ibus support?
Comment 8 Bastien Nocera 2012-10-04 11:30:18 UTC
(In reply to comment #5)
> I also think the initial trigger key is Ctrl+space for CJKI users.

Separate bug I think. See bug 682319.

Actually, can't we do that as well? Language-specific defaults translated by the translators...
Comment 9 Rui Matos 2012-10-04 14:31:29 UTC
(In reply to comment #8)
> Actually, can't we do that as well? Language-specific defaults translated by
> the translators...

I'm not sure this would work because, AFAIK, translations are determined from LC_MESSAGES and that's not an optimal way to do these defaults as I was told that a lot of people prefer en_US for LC_MESSAGES.

And anyway, I'd like to see this code going away soon rather than late when we get the initial setup story straight because that's the place where the user should be choosing this kind of thing for a newly created account. So, I regard this as a temporary painkiller only.
Comment 10 Rui Matos 2012-10-04 14:33:23 UTC
(In reply to comment #4)
> Can't the locale_engine list be unified with the supported_engines list in
> g-c-c somehow?  I expect that they will soon have several duplicates and
> maintaining them in two places would be cumbersome.

See comment #9 - this is only a temporary thing until initial setup is ready.
Comment 11 Rui Matos 2012-10-04 14:40:40 UTC
Created attachment 225813 [details] [review]
keyboard: Slight refactoring for upcoming changes

--
Removed curlies.
Comment 12 Rui Matos 2012-10-04 14:48:43 UTC
Created attachment 225815 [details] [review]
keyboard: Add likely IBus engine for some locales if empty setting

--

(In reply to comment #7)
> Are those really all the locales we can handle?

This are the obvious ones for me. I'm always sort of expecting that
local users will contribute with their opinion for these things...

> Can you add a reference to where you found this magic?

For ja_JP and ko_KR, those are the only ones available, for the others
I used Mathieu's awesome writeup[1] and an hint on IRC. Since this
should go way for 3.8 I don't think it's worth it to make it much more
sophisticated.

[1] http://bochecha.fedorapeople.org/chinese_ims/

> @@ +1346,2 @@
>  static void
> +init_builder_with_sources (GVariantBuilder *builder,
>
> Move this up so you don't need to declare it. And is it used when building
> without ibus support?

That was because I was trying to keep the code slinging at a minimum
taking into account the other patch for converting old settings which
also uses this. But moving code is cheap so, ack.
Comment 13 Bastien Nocera 2012-10-05 12:49:05 UTC
Review of attachment 225815 [details] [review]:

++
Comment 14 Rui Matos 2012-10-05 14:26:34 UTC
Attachment 225813 [details] pushed as c33ff6c - keyboard: Slight refactoring for upcoming changes
Attachment 225815 [details] pushed as 2c1f886 - keyboard: Add likely IBus engine for some locales if empty setting
Comment 15 Akira TAGOH 2012-10-12 04:58:25 UTC
I was expecting this works for new user account at least but seems not working in some case. I tried the following steps once removing an user and create one:

Test case 1:
1. Log in with Japanese
2. Look at the input source selector at the panel

Result 1:
No input source for ibus-anthy

Test case 2:
1. Log in with Japanese
2. Look at the input source selector at the panel
3. Log out
4. Log in and look at the input source

Result 2:
No input source for ibus-anthy

Test case 3:
1. Log in with Japanese
2. Look at the input source selector at the panel
3. Open Region and Language at the System Settings
4. wait for a while...

Result 3:
No input source for ibus-anthy at the panel but it appears on R&L window after waiting for a minute or so.

Test case 4:
1. Log in with Japanese
2. Look at the input source selector at the panel
3. Log out
4. Log in and open Region and Language at the System Settings
5. wait for a while...

Result 4:
No input source for ibus-anthy even though waiting for some time.


As per the above results, it looks like opening R&L window is a trigger to be added the default engine. I'm not sure if it's expected behavior, but that would be nice if g-s-d can adds one without any extra operation.
Comment 16 Akira TAGOH 2012-10-12 05:40:22 UTC
Hmm, it's a bit laggy. no relevant to R&L window at all. sorry for confusion.