aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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 ();