appcore_set_event_callback (APPCORE_EVENT_LANG_CHANGE,
lang_changed, ad);
- ecore_event_handler_add (ECORE_EVENT_KEY_DOWN, _keydown_event, ad);
- ecore_event_handler_add (ECORE_EVENT_KEY_UP, _keyup_event, ad);
+ ad->key_down_handler = ecore_event_handler_add (ECORE_EVENT_KEY_DOWN, _keydown_event, ad);
+ ad->key_up_handler = ecore_event_handler_add (ECORE_EVENT_KEY_UP, _keyup_event, ad);
appcore_measure_time ();
static int app_exit (void *data)
{
struct appdata *ad = (struct appdata *)data;
+
+ if (ad->key_down_handler) {
+ ecore_event_handler_del (ad->key_down_handler);
+ ad->key_down_handler = NULL;
+ }
+
+ if (ad->key_up_handler) {
+ ecore_event_handler_del (ad->key_up_handler);
+ ad->key_up_handler = NULL;
+ }
+
if (ad->li != NULL) {
evas_object_del (ad->li);
ad->li = NULL;
#endif
#ifndef WAYLAND
+static Ecore_Event_Handler *prop_handler = NULL;
+
static void _back_key_cb (void *data, Evas_Object *obj, void *event_info)
{
ecore_x_test_fake_key_press ("XF86Back");
{
Ecore_X_Event_Window_Property *ev;
ev = (Ecore_X_Event_Window_Property *)event;
+ if (!ev) return ECORE_CALLBACK_PASS_ON;
if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) {
LOGD ("[ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE] ");
return ef;
}
+static void
+_layout_del_cb (void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ if (prop_handler) {
+ ecore_event_handler_del (prop_handler);
+ prop_handler = NULL;
+ }
+}
+
static Evas_Object * create_inner_layout (void *data)
{
struct appdata *ad = (struct appdata *)data;
elm_box_pack_end (bx, rotate_btn);
#ifndef WAYLAND
- ecore_event_handler_add (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change_cb, NULL);
+ prop_handler = ecore_event_handler_add (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change_cb, NULL);
#endif
+ evas_object_event_callback_add (bx, EVAS_CALLBACK_DEL, _layout_del_cb, NULL);
+
return bx;
}