static E_Client *_ind_server = NULL;
static E_Client *_ind_owner = NULL;
+static struct wl_listener _ind_client_destroy_listener;
/* event handler */
static Eina_List *_ind_handlers = NULL;
-static Eina_List *_ind_hooks = NULL;
static int _ind_angle = -1;
static Eina_Bool
E_FREE_LIST(_ind_handlers, ecore_event_handler_del);
_ind_handlers = NULL;
- E_FREE_LIST(_ind_hooks, e_client_hook_del);
- _ind_hooks = NULL;
+ wl_list_remove(&_ind_client_destroy_listener.link);
+ _ind_client_destroy_listener.notify = NULL; /* hack to prevent double free */
_ind_server = NULL;
}
static void
-_indicator_cb_client_del(void *d EINA_UNUSED, E_Client *ec)
+_indicator_cb_client_destroy(struct wl_listener *listener, void *data)
{
- EINA_SAFETY_ON_NULL_RETURN(ec);
-
- if (_ind_server != ec) return;
-
_indicator_client_unset();
}
E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN, _indicator_cb_rot_begin, NULL);
E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL, _indicator_cb_rot_done, NULL);
E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_END, _indicator_cb_rot_done, NULL);
- E_LIST_HOOK_APPEND(_ind_hooks, E_CLIENT_HOOK_DEL, _indicator_cb_client_del, NULL);
+
+ // e_client listeners
+ _ind_client_destroy_listener.notify = _indicator_cb_client_destroy;
+ e_client_destroy_listener_add(ec, &_ind_client_destroy_listener);
_ind_server = ec;
if (!_ind_owner)