GNOME Bugzilla – Bug 734980
use IBus 1.5 api when obtain keyboard variant & option.
Last modified: 2014-09-17 13:51:20 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.
Created attachment 283710 [details] [review] use IBus 1.5 api when obtain keyboard variant & option
Wait, did this stop working ? Can you point me to an engine/configuration/version where the current code doesn't work anymore?
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.
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?
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.
(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...)
(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.
(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))
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.
All that code moved to gnome-shell. Please file a new bug against gnome-shell if it still applies.