aboutsummaryrefslogtreecommitdiff
path: root/lib/main.vala
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2014-09-12 15:45:12 -0400
committerWilliam Hua <william.hua@canonical.com>2014-09-12 15:45:12 -0400
commit96eb59ce4d5cdfe4c4a605258966497d8f674f5e (patch)
tree15730a7ededbe1ef805783312e3affc24802d003 /lib/main.vala
parent506ff05f6243b34ed59485fc28ff23867f377c72 (diff)
downloadayatana-indicator-keyboard-96eb59ce4d5cdfe4c4a605258966497d8f674f5e.tar.gz
ayatana-indicator-keyboard-96eb59ce4d5cdfe4c4a605258966497d8f674f5e.tar.bz2
ayatana-indicator-keyboard-96eb59ce4d5cdfe4c4a605258966497d8f674f5e.zip
Fcitx proxy.
Diffstat (limited to 'lib/main.vala')
-rw-r--r--lib/main.vala15
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 ();