Merge pull request #8036 from TheSchlunz/TheSchlunz/issue7540

chore(linux): log failures to `km_kbp_context_clear(context)`
This commit is contained in:
Eberhard Beilharz 2023-01-19 11:46:49 +01:00 • committed by GitHub
commit d20812d043
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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__);
}
}