From 96eb59ce4d5cdfe4c4a605258966497d8f674f5e Mon Sep 17 00:00:00 2001 From: William Hua Date: Fri, 12 Sep 2014 15:45:12 -0400 Subject: Fcitx proxy. --- lib/main.vala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') 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; @@ -221,6 +223,19 @@ public class Indicator.Keyboard.Service : Object { return ibus_panel; } + [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) { -- cgit v1.2.3