clean up client delete+unfocus
authorMike Blumenkrantz <zmike@samsung.com>
Mon, 27 Jan 2014 14:43:35 +0000 (09:43 -0500)
committerMike Blumenkrantz <zmike@samsung.com>
Mon, 27 Jan 2014 15:58:41 +0000 (10:58 -0500)
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
src/bin/e_comp_object.c

index 47a0149..502a9f7 100644 (file)
@@ -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;
      }
index 5b76485..cfa9245 100644 (file)
@@ -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