Permalink
Browse files

Enable undo-commit iff IBUS_CAP_SURROUNDING_TEXT is set.

Ibus doesn't have any appropriate capability flag to indicate
when we can reliably use |ibus_engine_delete_surrounding_text|.

With this CL, undo-commit is enabled more conservatively.  It now
requires the client to set IBUS_CAP_SURROUNDING_TEXT bit.

Closes #296.

BUG=#296
TEST=compile
  • Loading branch information...
1 parent 5f4bcac commit 0796f5143400e2beb3d18156ae426f8ce06b0c0d @yukawa yukawa committed Aug 15, 2015
Showing with 7 additions and 9 deletions.
  1. +1 −1 src/mozc_version_template.txt
  2. +6 −8 src/unix/ibus/mozc_engine.cc
@@ -1,6 +1,6 @@
MAJOR=2
MINOR=17
-BUILD=2107
+BUILD=2108
REVISION=102
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
# downloaded by NaCl Mozc.
@@ -716,14 +716,12 @@ bool MozcEngine::ExecuteCallback(IBusEngine *engine,
switch (callback_command.type()) {
case commands::SessionCommand::UNDO:
- // As far as I've tested on Ubuntu 11.10, most of applications which
- // accept 'ibus_engine_delete_surrounding_text' doe not set
- // IBUS_CAP_SURROUNDING_TEXT bit.
- // So we should carefully uncomment the following code.
- // -----
- // if (!(engine->client_capabilities & IBUS_CAP_SURROUNDING_TEXT)) {
- // return false;
- // }
+ // Having |IBUS_CAP_SURROUNDING_TEXT| does not necessarily mean that the
+ // client supports |ibus_engine_delete_surrounding_text()|, but there is
+ // no other good criteria.
+ if (!(engine->client_capabilities & IBUS_CAP_SURROUNDING_TEXT)) {
+ return false;
+ }
break;
case commands::SessionCommand::CONVERT_REVERSE: {
if (!GetSurroundingText(engine,

0 comments on commit 0796f51

Please sign in to comment.