Add HW back callback event #2 09/80409/2 accepted/tizen/common/20160718.155537 accepted/tizen/ivi/20160718.104014 accepted/tizen/mobile/20160718.103947 accepted/tizen/tv/20160718.104001 accepted/tizen/wearable/20160718.103925 submit/tizen/20160718.013158
authorHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 18 Jul 2016 04:14:55 +0000 (13:14 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 18 Jul 2016 04:28:38 +0000 (13:28 +0900)
Change-Id: I9bb93966345ce4754cba338db1f66c7007ed2bf3
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
src/bt-syspopup-w.c

index e76d33e..d6c9b6e 100644 (file)
@@ -640,6 +640,18 @@ static void __bluetooth_authorization_request_cb(void *data,
        __bluetooth_win_del(ad);
 }
 
+static void __bluetooth_back_key_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       FN_START;
+
+       struct bt_popup_appdata *ad = data;
+
+       __bluetooth_remove_all_event(ad);
+       __bluetooth_win_del(ad);
+
+       FN_END;
+}
+
 static void __bluetooth_ime_hide(void)
 {
        Ecore_IMF_Context *imf_context = NULL;
@@ -1917,19 +1929,6 @@ void __bluetooth_set_color_table(void *data)
        FN_END;
 }
 
-static void __bluetooth_back_key_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       FN_START;
-
-       struct bt_popup_appdata *ad = data;
-
-       __bluetooth_remove_all_event(ad);
-       __bluetooth_win_del(ad);
-
-       FN_END;
-}
-
-
 static bool __bluetooth_create(void *data)
 {
        struct bt_popup_appdata *ad = data;
@@ -1994,10 +1993,11 @@ static void __bluetooth_terminate(void *data)
        }
 #endif
 
-       eext_object_event_callback_del(ad->win_main, EEXT_CALLBACK_BACK, __bluetooth_back_key_cb);
 
-       if (ad->popup)
+       if (ad->popup) {
+               eext_object_event_callback_del(ad->popup, EEXT_CALLBACK_BACK, __bluetooth_back_key_cb);
                evas_object_del(ad->popup);
+       }
 
        if (ad->win_main)
                evas_object_del(ad->win_main);
@@ -2107,7 +2107,8 @@ DONE:
                        __lock_display();
        }
 
-       eext_object_event_callback_add(ad->win_main, EEXT_CALLBACK_BACK, __bluetooth_back_key_cb, ad);
+       if (ad->popup)
+               eext_object_event_callback_add(ad->popup, EEXT_CALLBACK_BACK, __bluetooth_back_key_cb, ad);
 
        return;
 }