diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2015-01-06 12:03:07 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2015-01-06 12:03:07 +0900 |
commit | 83451e476b5ec98aa38e333038077f9e5b2b087d (patch) | |
tree | 77cd6bfb4aba151d831c7afae98ff94baa736484 /ui | |
parent | 1b668f667eaef08dfbbbdf04a0865ea086f4250a (diff) | |
download | ibus-83451e476b5ec98aa38e333038077f9e5b2b087d.tar.gz |
Run ibus_bus_preload_engines_async 30 seconds later in ibus-ui-gtk3
Make sure to run the primary ibus engine at first to avoid
the duplicated IO.
TEST=ui/gtk3/ibus-ui-gtk3
Review URL: https://codereview.appspot.com/187700043
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk3/panel.vala | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala index 4e021409..b9b8e690 100644 --- a/ui/gtk3/panel.vala +++ b/ui/gtk3/panel.vala @@ -65,6 +65,8 @@ class Panel : IBus.PanelService { red = 0.0, green = 0.0, blue = 0.0, alpha = 1.0 }; private XKBLayout m_xkblayout = new XKBLayout(); private bool inited_engines_order = true; + private uint m_preload_engines_id; + private const uint PRELOAD_ENGINES_DELAY_TIME = 30000; private GLib.List<Keybinding> m_keybindings = new GLib.List<Keybinding>(); @@ -764,8 +766,21 @@ class Panel : IBus.PanelService { return; } + if (m_preload_engines_id != 0) { + GLib.Source.remove(m_preload_engines_id); + m_preload_engines_id = 0; + } + names += engines[index].get_name(); - m_bus.preload_engines_async.begin(names, -1, null); + m_preload_engines_id = + Timeout.add( + PRELOAD_ENGINES_DELAY_TIME, + () => { + m_bus.preload_engines_async.begin(names, + -1, + null); + return false; + }); } private void update_engines(string[]? unowned_engine_names, |