From: Jihoon Kim Date: Thu, 23 Feb 2017 02:33:17 +0000 (+0900) Subject: Reduce the number of string compare in processing back key X-Git-Tag: accepted/tizen/common/20170223.183904~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0090cd1ebc246b4c92291b7c7ace6cfc4bfc9b7;p=platform%2Fcore%2Fuifw%2Fise-default.git Reduce the number of string compare in processing back key Change-Id: I00ce1122039339acbcaca317ca8c70b55f6ab1bd Signed-off-by: Jihoon Kim --- diff --git a/src/ise.cpp b/src/ise.cpp index 5123ece..1434428 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -1522,9 +1522,19 @@ void ise_update_table(const vector &vec_str) void ise_process_key_event(scim::KeyEvent& key, sclu32 &ret) { - if (key.get_key_string().compare("KeyRelease+XF86Back") == 0 || key.get_key_string().compare("XF86Back") == 0) { + Eina_Bool back_key_pressed = EINA_FALSE; + Eina_Bool back_key_released = EINA_FALSE; + + if (key.get_key_string().compare("XF86Back") == 0) { + back_key_pressed = EINA_TRUE; + } + else if (key.get_key_string().compare("KeyRelease+XF86Back") == 0) { + back_key_released = EINA_TRUE; + } + + if (back_key_pressed || back_key_released) { if (g_popup_opened == TRUE) { - if (key.get_key_string().compare("KeyRelease+XF86Back") == 0) { + if (back_key_released) { g_ui->close_all_popups(); g_popup_opened = FALSE; }