Skip to content

Commit

Permalink
Enable undo-commit iff IBUS_CAP_SURROUNDING_TEXT is set.
Browse files Browse the repository at this point in the history
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
yukawa committed Aug 15, 2015
1 parent 5f4bcac commit 0796f51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/mozc_version_template.txt
@@ -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.
Expand Down
14 changes: 6 additions & 8 deletions src/unix/ibus/mozc_engine.cc
Expand Up @@ -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,
Expand Down

0 comments on commit 0796f51

Please sign in to comment.