Insert back key function in Wearble and Remove useless varibale "win" 48/76148/2 accepted/tizen/common/20160623.154309 accepted/tizen/mobile/20160623.123911 accepted/tizen/tv/20160623.123924 accepted/tizen/wearable/20160623.123944 submit/tizen/20160623.040659
authorchangjoo.lee <changjoo.lee@samsung.com>
Thu, 23 Jun 2016 03:02:02 +0000 (12:02 +0900)
committerchangjoo.lee <changjoo.lee@samsung.com>
Thu, 23 Jun 2016 03:06:43 +0000 (12:06 +0900)
Change-Id: I722a60472b7cf452c5aa3ac72542d086c7fc26fe
Signed-off-by: changjoo.lee <changjoo.lee@samsung.com>
src/common/popup-ui-circle.c
src/powerkey/powerkey.c

index d2126df..f2c2e53 100755 (executable)
 
 #define BUF_MAX 512
 
+void event_back_key_up(void *data, Evas_Object *obj, void *event_info)
+{
+       const struct popup_ops *ops = data;
+       Evas_Object *win;
+
+       win = get_window();
+       if (win)
+               eext_object_event_callback_del(obj, EEXT_CALLBACK_BACK, event_back_key_up);
+
+       if (ops)
+               unload_simple_popup(ops);
+       terminate_if_no_popup();
+}
+
 int load_normal_popup(const struct popup_ops *ops)
 {
        Evas_Object *btn;
@@ -140,6 +154,7 @@ int load_normal_popup(const struct popup_ops *ops)
                }
        }
 
+       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, event_back_key_up, (void*)ops);
        evas_object_show(popup);
 
        obj->popup = popup;
index 24898c9..0c264de 100755 (executable)
@@ -258,8 +258,6 @@ static void pm_state_changed(keynode_t *key, void *data)
 
 static void register_handlers(const struct popup_ops *ops)
 {
-       Evas_Object *win;
-
        if (vconf_notify_key_changed(
                VCONFKEY_PM_STATE,
                pm_state_changed,
@@ -269,8 +267,6 @@ static void register_handlers(const struct popup_ops *ops)
 
 static void unregister_handlers(const struct popup_ops *ops)
 {
-       Evas_Object *win;
-
        vconf_ignore_key_changed(VCONFKEY_PM_STATE, pm_state_changed);
 }