char *right_btn;
} popup_info_s;
+typedef struct {
+ Ecore_Event_Handler *key_event_handler;
+} ui_data_s;
+
app_control_h create_syspopup_app_control(appcontrol_s *list, const char *id);
int create_syspopup_notification(notification_s *list, const char *id, app_control_h app_control);
popup_info_s *get_popup_info(const char *id);
Evas_Object *create_toast_popup(Evas_Object *parent, popup_info_s *body, void *user_data);
Evas_Object *create_password_enforce_change_popup(Evas_Object *parent, popup_info_s *info, void *user_data);
-void create_syspopup(const char *id, void *user_data);
+void create_syspopup(const char *id, void *user_data, ui_data_s *ui_data);
#endif /* __DPM_SYSPOPUP_H__ */
int ret = 0;
char *id = NULL;
char *user_data = NULL;
+ ui_data_s *ui_data = (ui_data_s *)data;
ret = app_control_get_extra_data(app_control, "id", &id);
if (ret != APP_CONTROL_ERROR_NONE) {
return;
}
- create_syspopup(id, user_data);
+ create_syspopup(id, user_data, ui_data);
free(id);
free(user_data);
static void app_terminate(void *data)
{
+ ui_data_s *ui_data = (ui_data_s *)data;
+
+ if (ui_data->key_event_handler) {
+ dlog_print(DLOG_INFO, LOG_TAG, "delete key event handler");
+ ecore_event_handler_del(ui_data->key_event_handler);
+ ui_data->key_event_handler = NULL;
+ }
return;
}
int ret = 0;
ui_app_lifecycle_callback_s event_callback = {0, };
app_event_handler_h handlers[5] = {NULL, };
+ ui_data_s ui_data = {0,};
event_callback.create = app_create;
event_callback.terminate = app_terminate;
event_callback.resume = app_resume;
event_callback.app_control = app_control;
- ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ui_data);
- ret = ui_app_main(argc, argv, &event_callback, NULL);
+ ret = ui_app_main(argc, argv, &event_callback, &ui_data);
if (ret != APP_ERROR_NONE)
dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret);
return EINA_TRUE;
}
-void create_syspopup(const char *id, void *user_data)
+void create_syspopup(const char *id, void *user_data, ui_data_s *ui_data)
{
Evas_Object *window = NULL, *popup = NULL;
popup_info_s *info = NULL;
popup = create_password_enforce_change_popup(window, info, NULL);
} else {
popup = create_default_popup(window, info, user_data);
- ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, key_event_cb, popup);
+ if (strcmp(id, "password-enforce-change")) {
+ ui_data->key_event_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, key_event_cb, popup);
+ }
}
free(manufacturer);
break;
case DPM_SYSPOPUP_TOAST:
popup = create_toast_popup(window, info, NULL);
- ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, key_event_cb, popup);
+ ui_data->key_event_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, key_event_cb, popup);
break;
default:
dlog_print(DLOG_ERROR, LOG_TAG, "Invalid view type");
elm_win_title_set(window, pkg_name);
elm_win_borderless_set(window, EINA_TRUE);
elm_win_alpha_set(window, EINA_TRUE);
+ elm_win_autodel_set(window, EINA_TRUE);
evas_object_smart_callback_add(window, "delete,request", win_delete_request_cb, NULL);
evas_object_show(window);