SCLDisplayMode display_mode = g_ui->get_display_mode();
if (display_mode >= 0 && display_mode < DISPLAYMODE_MAX) {
- SclSize rect = g_ui->get_input_mode_size(g_ui->get_input_mode(), display_mode);
- if (g_config_values.floating_mode)
- evas_object_resize(layout_main, rect.width * FLOATING_SCALE_RATE, rect.height * FLOATING_SCALE_RATE);
- else
- evas_object_resize(layout_main, rect.width, rect.height);
+ const char *input_mode = g_ui->get_input_mode();
+ if (input_mode) {
+ SclSize rect = g_ui->get_input_mode_size(input_mode, display_mode);
+ if (g_config_values.floating_mode)
+ evas_object_resize(layout_main, rect.width * FLOATING_SCALE_RATE, rect.height * FLOATING_SCALE_RATE);
+ else
+ evas_object_resize(layout_main, rect.width, rect.height);
+ }
}
evas_object_layer_set(layout_main, 32000);
if (desc && g_ui) {
set_ime_size(g_floating_mode, ISE_CANDIDATE_REQ_NONE);
- if (strcmp(g_ui->get_input_mode(), "STT_3X4") == 0 &&
- strcmp(desc->input_mode, "STT_3X4") != 0) {
- ise_hide_stt_mode();
- }
- if (strcmp(g_ui->get_input_mode(), "STT_3X4") != 0 &&
- strcmp(desc->input_mode, "STT_3X4") == 0) {
- ise_show_stt_mode(NATIVE_WINDOW_CAST(ime_get_main_window()));
+ const char *input_mode = g_ui->get_input_mode();
+ if (input_mode) {
+ if (strcmp(input_mode, "STT_3X4") == 0 &&
+ strcmp(desc->input_mode, "STT_3X4") != 0) {
+ ise_hide_stt_mode();
+ }
+ if (strcmp(input_mode, "STT_3X4") != 0 &&
+ strcmp(desc->input_mode, "STT_3X4") == 0) {
+ ise_show_stt_mode(NATIVE_WINDOW_CAST(ime_get_main_window()));
+ }
}
}
}
ret = SCL_EVENT_DONE;
} else if (strcmp(event_desc.key_value, "Cancel") == 0) {
ret = SCL_EVENT_DONE;
- if (strcmp(g_ui->get_input_mode(), "STT_3X4") == 0 ) {
+ const sclchar *input_mode = g_ui->get_input_mode();
+ if (input_mode && strcmp(input_mode, "STT_3X4") == 0 ) {
g_keyboard_state.need_reset = TRUE;
voice_result_string_flush();
ise_set_layout(g_keyboard_state.layout, g_keyboard_state.layout_variation);
}
}
+ const char *input_mode = g_ui->get_input_mode();
+
/* Reset input mode if the input context value has changed */
if (ic != g_keyboard_state.ic) {
/* Do not reset input mode if STT's setting window was opened */
- if (g_setting_window_open_status && strcmp(g_ui->get_input_mode(), "STT_3X4") == 0) {
+ if (g_setting_window_open_status && input_mode && strcmp(input_mode, "STT_3X4") == 0) {
LOGD("Setting window was opened while using STT, skip resetting input mode");
} else {
reset_inputmode = TRUE;
/* No matter what, just reset the inputmode if it needs to */
if (g_keyboard_state.need_reset) {
/* Do not reset input mode if STT's setting window was opened */
- if (g_setting_window_open_status && strcmp(g_ui->get_input_mode(), "STT_3X4") == 0) {
+ if (g_setting_window_open_status && input_mode && strcmp(input_mode, "STT_3X4") == 0) {
LOGD("Setting window was opened while using STT, skip resetting input mode");
} else {
reset_inputmode = TRUE;
_reset_multitap_state(true);
/* If we were in STT mode, try to reset input mode on our next show event */
- const char *inputmode = (g_ui ? g_ui->get_input_mode() : NULL);
- if (g_ui && inputmode && strcmp(inputmode, "STT_3X4") == 0 ) {
- g_keyboard_state.need_reset = TRUE;
- ise_hide_stt_mode();
+ if (g_ui) {
+ const char *inputmode = g_ui->get_input_mode();
+ if (inputmode && strcmp(inputmode, "STT_3X4") == 0 ) {
+ g_keyboard_state.need_reset = TRUE;
+ ise_hide_stt_mode();
+ }
}
g_input_panel_show = false;
if (!g_ui)
return;
- SclSize size_portrait = g_ui->get_input_mode_size(g_ui->get_input_mode(), DISPLAYMODE_PORTRAIT);
- SclSize size_landscape = g_ui->get_input_mode_size(g_ui->get_input_mode(), DISPLAYMODE_LANDSCAPE);
+ const char *input_mode = g_ui->get_input_mode();
+ if (!input_mode)
+ return;
+
+ SclSize size_portrait = g_ui->get_input_mode_size(input_mode, DISPLAYMODE_PORTRAIT);
+ SclSize size_landscape = g_ui->get_input_mode_size(input_mode, DISPLAYMODE_LANDSCAPE);
if (floating_mode) {
size_portrait.width *= FLOATING_SCALE_RATE;