From 9d2d6ebdc2d67c48d3b5093576cab3302ae21dc2 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 7 Feb 2018 15:49:41 +0900 Subject: [PATCH] Update popup open state variable on POPUP_ notification events Change-Id: I9517049cefb9afb9b842e0fc66f355c9f275be49 --- src/ise.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ise.cpp b/src/ise.cpp index e2a7558..6687421 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -706,6 +706,16 @@ SCLEventReturnType CUIEventCallback::on_event_notification(SCLUINotiType noti_ty } else if (0 == strcmp(openedDesc->input_mode, "CM_POPUP")) { _cm_popup_opened = TRUE; } + } else if (noti_type == SCL_UINOTITYPE_POPUP_CLOSED) { + g_popup_opened = FALSE; + SclNotiPopupClosedDesc *closedDesc = (SclNotiPopupClosedDesc *)etc_info; + if (closedDesc && closedDesc->input_mode) { + if (0 == strcmp(closedDesc->input_mode, "PUNCTUATION_POPUP")) { + g_punctuation_popup_opened = FALSE; + } else if (0 == strcmp(closedDesc->input_mode, "CM_POPUP")) { + _cm_popup_opened = FALSE; + } + } } else if (noti_type == SCL_UINOTITYPE_INPUT_MODE_CHANGE) { SclNotiInputModeChangeDesc *desc = static_cast(etc_info); if (desc && g_ui) { @@ -946,8 +956,6 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d } } else if (g_punctuation_popup_opened) { update_recent_used_punctuation(event_desc.key_value); - g_punctuation_popup_opened = FALSE; - g_popup_opened = FALSE; } break; } @@ -1310,7 +1318,6 @@ ise_show(int ic) exit_timer = NULL; #endif sclboolean reset_inputmode = FALSE; - g_popup_opened = FALSE; g_input_panel_show = true; if (g_ui) { @@ -2137,7 +2144,6 @@ void ise_process_key_event(scim::KeyEvent& key, sclu32 &ret) if (g_popup_opened == TRUE) { if (back_key_released) { g_ui->close_all_popups(); - g_popup_opened = FALSE; } ret = 1; return; -- 2.7.4