elput: add null checks for xkb compose pointers

somehow these can fail to be created
This commit is contained in:
Mike Blumenkrantz 2017-06-02 18:23:44 -04:00
parent c60fbea89f
commit 8d08119fdd
1 changed files with 4 additions and 4 deletions

View File

@ -200,11 +200,11 @@ _keyboard_compose_init(Elput_Keyboard *kbd)
if (kbd->compose_table) xkb_compose_table_unref(kbd->compose_table);
kbd->compose_table = xkb_compose_table_new_from_locale(kbd->context, locale,
XKB_COMPOSE_COMPILE_NO_FLAGS);
if (kbd->compose_state) xkb_compose_state_unref(kbd->compose_state);
if (kbd->compose_table)
{
if (kbd->compose_state) xkb_compose_state_unref(kbd->compose_state);
kbd->compose_state = xkb_compose_state_new(kbd->compose_table, XKB_COMPOSE_STATE_NO_FLAGS);
}
kbd->compose_state = xkb_compose_state_new(kbd->compose_table, XKB_COMPOSE_STATE_NO_FLAGS);
else
kbd->compose_state = NULL;
}
static Eina_Bool