From cd2cde6477f8c711bb8c9c292394d84abf03cbc7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 27 Jan 2014 09:43:35 -0500 Subject: [PATCH] clean up client delete+unfocus previously there were cases where client focus was not explicitly unset on delete, which resulted in expected client hooks not being called and minor inconveniences to occur --- src/bin/e_client.c | 7 +++---- src/bin/e_comp_object.c | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 47a01490a..502a9f752 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -378,8 +378,6 @@ _e_client_revert_focus(E_Client *ec) static void _e_client_free(E_Client *ec) { - if (ec->focused) - e_client_focused_set(NULL); e_comp_object_redirected_set(ec->frame, 0); e_comp_object_render_update_del(ec->frame); @@ -534,6 +532,7 @@ _e_client_del(E_Client *ec) if (ec->focused) _e_client_revert_focus(ec); + evas_object_focus_set(ec->frame, 0); E_FREE_FUNC(ec->ping_poller, ecore_poller_del); /* must be called before parent/child clear */ @@ -3141,12 +3140,12 @@ e_client_focused_set(E_Client *ec) e_client_unfullscreen(ec_unfocus); } - /* only send event/hook here if we're not being deleted */ + _e_client_hook_call(E_CLIENT_HOOK_FOCUS_UNSET, ec_unfocus); + /* only send event here if we're not being deleted */ if ((!e_object_is_del(E_OBJECT(ec_unfocus))) && (e_object_ref_get(E_OBJECT(ec_unfocus)) > 0)) { _e_client_event_simple(ec_unfocus, E_EVENT_CLIENT_FOCUS_OUT); - _e_client_hook_call(E_CLIENT_HOOK_FOCUS_UNSET, ec_unfocus); } break; } diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 5b7648555..cfa92452b 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -1718,9 +1718,12 @@ _e_comp_smart_focus_in(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object } static void -_e_comp_smart_focus_out(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +_e_comp_smart_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { - e_comp_object_signal_emit(obj, "e,state,unfocused", "e"); + E_Comp_Object *cw = data; + + if (!e_object_is_del(E_OBJECT(cw->ec))) + e_comp_object_signal_emit(obj, "e,state,unfocused", "e"); } static void