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
Yohei Yukawa
8 years ago
0 | 0 |
MAJOR=2
|
1 | 1 |
MINOR=17
|
2 | |
BUILD=2107
|
|
2 |
BUILD=2108
|
3 | 3 |
REVISION=102
|
4 | 4 |
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
|
5 | 5 |
# downloaded by NaCl Mozc.
|
715 | 715 |
|
716 | 716 |
switch (callback_command.type()) {
|
717 | 717 |
case commands::SessionCommand::UNDO:
|
718 | |
// As far as I've tested on Ubuntu 11.10, most of applications which
|
719 | |
// accept 'ibus_engine_delete_surrounding_text' doe not set
|
720 | |
// IBUS_CAP_SURROUNDING_TEXT bit.
|
721 | |
// So we should carefully uncomment the following code.
|
722 | |
// -----
|
723 | |
// if (!(engine->client_capabilities & IBUS_CAP_SURROUNDING_TEXT)) {
|
724 | |
// return false;
|
725 | |
// }
|
|
718 |
// Having |IBUS_CAP_SURROUNDING_TEXT| does not necessarily mean that the
|
|
719 |
// client supports |ibus_engine_delete_surrounding_text()|, but there is
|
|
720 |
// no other good criteria.
|
|
721 |
if (!(engine->client_capabilities & IBUS_CAP_SURROUNDING_TEXT)) {
|
|
722 |
return false;
|
|
723 |
}
|
726 | 724 |
break;
|
727 | 725 |
case commands::SessionCommand::CONVERT_REVERSE: {
|
728 | 726 |
if (!GetSurroundingText(engine,
|