mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-07 22:47:29 +00:00
Merge pull request #8036 from TheSchlunz/TheSchlunz/issue7540
chore(linux): log failures to `km_kbp_context_clear(context)`
This commit is contained in:
commit
d20812d043
1 changed files with 6 additions and 1 deletions
|
|
@ -274,15 +274,20 @@ reset_context(IBusEngine *engine) {
|
|||
current_context_utf8 = get_current_context_text(context);
|
||||
if (!(*current_context_utf8) || !g_str_has_suffix(surrounding_text, current_context_utf8)) {
|
||||
g_message("%s: setting context because it has changed from expected", __FUNCTION__);
|
||||
if (km_kbp_context_items_from_utf8(surrounding_text, &context_items) == KM_KBP_STATUS_OK) {
|
||||
enum km_kbp_status_codes status = km_kbp_context_items_from_utf8(surrounding_text, &context_items);
|
||||
if (status == KM_KBP_STATUS_OK) {
|
||||
km_kbp_context_set(context, context_items);
|
||||
km_kbp_context_items_dispose(context_items);
|
||||
} else {
|
||||
km_kbp_context_clear(context);
|
||||
g_message("%s: setting context failed with status code %d", __FUNCTION__, status);
|
||||
}
|
||||
}
|
||||
g_free(surrounding_text);
|
||||
g_free(current_context_utf8);
|
||||
} else {
|
||||
km_kbp_context_clear(context);
|
||||
g_message("%s: client does not support surrounding text", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue