discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=f75a923ab0b35ebdd9fc39850451c1afd36f565c

commit f75a923ab0b35ebdd9fc39850451c1afd36f565c
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Thu Feb 20 11:47:44 2014 -0500

    break out client focus reset into separate function
---
 src/bin/e_client.c      | 16 ++++++++++++++++
 src/bin/e_client.h      |  1 +
 src/bin/e_comp.c        | 10 +---------
 src/bin/e_comp_object.c | 11 +----------
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index b27d2e2..45f824a 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -3007,6 +3007,22 @@ e_client_focus_track_thaw(void)
    focus_track_frozen--;
 }
 
+EAPI void
+e_client_refocus(void)
+{
+   E_Client *ec;
+   const Eina_List *l;
+
+   EINA_LIST_FOREACH(e_client_focus_stack_get(), l, ec)
+     if (ec->desk && ec->desk->visible && (!ec->iconic))
+       {
+          if (ec->comp->input_key_grabs || ec->comp->input_mouse_grabs) break;
+          evas_object_focus_set(ec->frame, 1);
+          break;
+       }
+}
+
+
 /*
  * Sets the focus to the given client if necessary
  * There are 3 cases of different focus_policy-configurations:
diff --git a/src/bin/e_client.h b/src/bin/e_client.h
index 06a8dec..194f0f3 100644
--- a/src/bin/e_client.h
+++ b/src/bin/e_client.h
@@ -755,6 +755,7 @@ EAPI void e_client_raise_latest_set(E_Client *ec);
 EAPI Eina_Bool e_client_focus_track_enabled(void);
 EAPI void e_client_focus_track_freeze(void);
 EAPI void e_client_focus_track_thaw(void);
+EAPI void e_client_refocus(void);
 EAPI void e_client_focus_set_with_pointer(E_Client *ec);
 EAPI void e_client_activate(E_Client *ec, Eina_Bool just_do_it);
 EAPI E_Client *e_client_focused_get(void);
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index a6b1d13..1d996a9 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -1748,8 +1748,6 @@ EAPI void
 e_comp_ungrab_input(E_Comp *c, Eina_Bool mouse, Eina_Bool kbd)
 {
    Ecore_Window mwin = 0, kwin = 0;
-   Eina_List *l;
-   E_Client *ec;
 
    mouse = !!mouse;
    kbd = !!kbd;
@@ -1766,13 +1764,7 @@ e_comp_ungrab_input(E_Comp *c, Eina_Bool mouse, 
Eina_Bool kbd)
    evas_event_feed_mouse_out(c->evas, 0, NULL);
    evas_event_feed_mouse_in(c->evas, 0, NULL);
    if (e_client_focused_get()) return;
-   EINA_LIST_FOREACH(e_client_focus_stack_get(), l, ec)
-     if (ec->desk && ec->desk->visible && (!ec->iconic))
-       {
-          if (ec->comp->input_key_grabs || ec->comp->input_mouse_grabs) break;
-          evas_object_focus_set(ec->frame, 1);
-          break;
-       }
+   e_client_refocus();
 }
 
 EAPI void
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index 5c0d507..98f0ea2 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -3493,19 +3493,10 @@ _e_comp_object_autoclose_show(void *data EINA_UNUSED, 
Evas *e EINA_UNUSED, Evas_
 static void
 _e_comp_object_autoclose_del(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj, void *event_info EINA_UNUSED)
 {
-   E_Client *ec;
-   Eina_List *l;
-
    evas_object_event_callback_del(obj, EVAS_CALLBACK_SHOW, 
_e_comp_object_autoclose_show);
    _e_comp_object_autoclose_cleanup(data, 1);
    if (e_client_focused_get()) return;
-   EINA_LIST_FOREACH(e_client_focus_stack_get(), l, ec)
-     if (ec->desk && ec->desk->visible && (!ec->iconic))
-       {
-          if (ec->comp->input_key_grabs || ec->comp->input_mouse_grabs) break;
-          evas_object_focus_set(ec->frame, 1);
-          break;
-       }
+   e_client_refocus();
 }
 
 EAPI void

-- 


Reply via email to