summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2018-09-14 14:48:18 +0800
committerPeng Wu <alexepico@gmail.com>2018-09-14 14:48:18 +0800
commit78c7636176951a8528dc9e2793d32a42680e434a (patch)
tree6db80103d44e32f49fbe6429a4b0e831cd52c860
parentf4d792986e5d52e6104d0e9ab159a8197608667d (diff)
downloadibus-libpinyin-78c7636176951a8528dc9e2793d32a42680e434a.tar.gz
ibus-libpinyin-78c7636176951a8528dc9e2793d32a42680e434a.tar.xz
ibus-libpinyin-78c7636176951a8528dc9e2793d32a42680e434a.zip
commit m_text when switch input mode
-rw-r--r--src/PYPBopomofoEngine.cc6
-rw-r--r--src/PYPPinyinEngine.cc6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/PYPBopomofoEngine.cc b/src/PYPBopomofoEngine.cc
index e2154d1..3621f1b 100644
--- a/src/PYPBopomofoEngine.cc
+++ b/src/PYPBopomofoEngine.cc
@@ -89,8 +89,12 @@ BopomofoEngine::processAccelKeyEvent (guint keyval, guint keycode,
}
if (triggered) {
- if (!m_editors[MODE_INIT]->text ().empty ())
+ if (!m_editors[MODE_INIT]->text ().empty ()) {
+ Text text (m_editors[MODE_INIT]->text ());
+ commitText (text);
m_editors[MODE_INIT]->reset ();
+ }
+
if (!m_editors[MODE_SUGGESTION]->text ().empty ())
m_editors[MODE_SUGGESTION]->reset ();
m_props.toggleModeChinese ();
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc
index 938c547..0c71ca3 100644
--- a/src/PYPPinyinEngine.cc
+++ b/src/PYPPinyinEngine.cc
@@ -164,8 +164,12 @@ PinyinEngine::processAccelKeyEvent (guint keyval, guint keycode,
}
if (triggered) {
- if (!m_editors[MODE_INIT]->text ().empty ())
+ if (!m_editors[MODE_INIT]->text ().empty ()) {
+ Text text (m_editors[MODE_INIT]->text ());
+ commitText (text);
m_editors[MODE_INIT]->reset ();
+ }
+
if (!m_editors[MODE_SUGGESTION]->text ().empty ())
m_editors[MODE_SUGGESTION]->reset ();
m_props.toggleModeChinese ();