diff options
author | William Hua <william.hua@canonical.com> | 2014-09-12 15:45:12 -0400 |
---|---|---|
committer | William Hua <william.hua@canonical.com> | 2014-09-12 15:45:12 -0400 |
commit | 96eb59ce4d5cdfe4c4a605258966497d8f674f5e (patch) | |
tree | 15730a7ededbe1ef805783312e3affc24802d003 | |
parent | 506ff05f6243b34ed59485fc28ff23867f377c72 (diff) | |
download | ayatana-indicator-keyboard-96eb59ce4d5cdfe4c4a605258966497d8f674f5e.tar.gz ayatana-indicator-keyboard-96eb59ce4d5cdfe4c4a605258966497d8f674f5e.tar.bz2 ayatana-indicator-keyboard-96eb59ce4d5cdfe4c4a605258966497d8f674f5e.zip |
Fcitx proxy.
-rw-r--r-- | lib/main.vala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/main.vala b/lib/main.vala index c5d4b6da..40354786 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -41,6 +41,8 @@ public class Indicator.Keyboard.Service : Object { private ulong ibus_connected_id; private uint panel_timeout; + private Fcitx.InputMethod? fcitx; + private Source[]? sources; private SimpleActionGroup? action_group; @@ -222,6 +224,19 @@ public class Indicator.Keyboard.Service : Object { } [DBus (visible = false)] + private Fcitx.InputMethod? get_fcitx () { + if (is_fcitx_active () && fcitx == null) { + try { + fcitx = new Fcitx.InputMethod (BusType.SESSION, DBusProxyFlags.NONE, 0); + } catch (Error error) { + warning ("error: %s", error.message); + } + } + + return fcitx; + } + + [DBus (visible = false)] public void up () { if (loop == null) { loop = new MainLoop (); |