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 734980 - use IBus 1.5 api when obtain keyboard variant & option.
use IBus 1.5 api when obtain keyboard variant & option.
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: keyboard
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Rui Matos
gnome-settings-daemon-maint
3.14
Depends on:
Blocks:
 
 
Reported: 2014-08-18 05:33 UTC by Jinkyu Yi
Modified: 2014-09-17 13:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use IBus 1.5 api when obtain keyboard variant & option (5.07 KB, patch)
2014-08-18 05:34 UTC, Jinkyu Yi
none Details | Review
use IBus 1.5 api when obtain keyboard variant & option --fix wrong argument and function usage (5.10 KB, patch)
2014-09-07 13:30 UTC, Jinkyu Yi
none Details | Review

Description Jinkyu Yi 2014-08-18 05:33:05 UTC
As of IBus 1.5, layout from IBusEngineDesc is no more special format
including variant & option. Instead it has some new apis able to
obtain these information easily.

This fixes gsd can't change keyboard variant & option described in
ibus 1.5's engine.
Comment 1 Jinkyu Yi 2014-08-18 05:34:59 UTC
Created attachment 283710 [details] [review]
use IBus 1.5 api when obtain keyboard variant & option
Comment 2 Rui Matos 2014-09-02 09:15:40 UTC
Wait, did this stop working ? Can you point me to an engine/configuration/version where the current code doesn't work anymore?
Comment 3 Jinkyu Yi 2014-09-02 13:14:10 UTC
Starting from IBus 1.5 current code shouldn't work anymore. See http://ibus.googlecode.com/svn/docs/ibus-1.5/IBusEngineDesc.html#ibus-engine-desc-get-layout and below.
It seems current code is using IBus 1.4.99's temporary ibus_engine_desc_get_layout() method.
I think engine/configuration is not important, anyway I found this bug while testing https://github.com/choehwanjin/ibus-hangul/pull/25 with IBus 1.5.8

Also, please have a look at Bug 735065 & Bug 735066
All these 3 bugs include patch for them.
Comment 4 Rui Matos 2014-09-02 14:48:22 UTC
Hi Takao, should we change to the new API to get the engine's layout variant? Do the engines need to change their component configuration?
Comment 5 Takao Fujiwara 2014-09-03 06:23:12 UTC
Right. we no longer use the format of "layout(variant)[options]".
ibus XKB engine has already used the new APIs although gnome-settings-daemon uses the owned input sources instead:

https://github.com/ibus/ibus/blob/master/engine/simple.xml.in

Some input method also uses variant and options.

Regarding to attachment #283710 [details], the arguments of g_utf8_strlen() is not right and g_strsplit() instead of g_utf8_strlen() for ibus_option.

BTW, kr(kr104) was removed in ibus XKB engines and the suggestion is to use Alt_R instead of Hangul key:
http://code.google.com/p/ibus/issues/detail?id=1708

So I think ibus-hangul should not be changed.
Comment 6 Jinkyu Yi 2014-09-04 16:54:59 UTC
(In reply to comment #5)
> Right. we no longer use the format of "layout(variant)[options]".
> ibus XKB engine has already used the new APIs although gnome-settings-daemon
> uses the owned input sources instead:
> 
> https://github.com/ibus/ibus/blob/master/engine/simple.xml.in
> 
> Some input method also uses variant and options.
> 
> Regarding to attachment #283710 [details], the arguments of g_utf8_strlen() is not right
> and g_strsplit() instead of g_utf8_strlen() for ibus_option.
Sorry, I can't understand.
The reason I add g_utf8_strlen() is to check if input method doesn't define layout(variant/option) not parsing string.
In my test, if input method doesn't define one of it, it seems IBus returns empty string("" not NULL) and caused gsd crash.
> 
> BTW, kr(kr104) was removed in ibus XKB engines and the suggestion is to use
> Alt_R instead of Hangul key:
> http://code.google.com/p/ibus/issues/detail?id=1708
> 
> So I think ibus-hangul should not be changed.
In short, the reason I did is Alt_R is not in default toggle key list in ibus-hangul.
(I think it still needs some more discussions...)
Comment 7 Takao Fujiwara 2014-09-05 02:19:07 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Regarding to attachment #283710 [details] [details], the arguments of g_utf8_strlen() is not right
> > and g_strsplit() instead of g_utf8_strlen() for ibus_option.
> Sorry, I can't understand.

-+                        if (g_utf8_strlen (ibus_layout ))
++                        if (g_utf8_strlen (ibus_layout, NULL))

-+                                options = g_strdup (ibus_option );
++                                options = g_strsplit (ibus_option, ",", 0);

> > BTW, kr(kr104) was removed in ibus XKB engines and the suggestion is to use
> > Alt_R instead of Hangul key:
> > http://code.google.com/p/ibus/issues/detail?id=1708
> > 
> > So I think ibus-hangul should not be changed.
> In short, the reason I did is Alt_R is not in default toggle key list in
> ibus-hangul.
> (I think it still needs some more discussions...)

Then the default would be Alt_R.
Comment 8 Takao Fujiwara 2014-09-05 02:20:24 UTC
(In reply to comment #7)
> -+                        if (g_utf8_strlen (ibus_layout ))
> ++                        if (g_utf8_strlen (ibus_layout, NULL))

It was typo.
-+                        if (g_utf8_strlen (ibus_layout ))
++                        if (g_utf8_strlen (ibus_layout, -1))
Comment 9 Jinkyu Yi 2014-09-07 13:30:44 UTC
Created attachment 285613 [details] [review]
 use IBus 1.5 api when obtain keyboard variant & option --fix wrong argument and function usage

Fix  wrong argument and function usage by comment #5, comment #7, comment #8.
Comment 10 Bastien Nocera 2014-09-17 13:51:20 UTC
All that code moved to gnome-shell. Please file a new bug against gnome-shell if it still applies.