cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=859f31102e9b4d776a144872a4b839cc509a9628

commit 859f31102e9b4d776a144872a4b839cc509a9628
Author: Jee-Yong Um <jc9...@samsung.com>
Date:   Fri Mar 4 15:37:17 2016 -0800

    win: add check for focus object before adding new one
    
    Summary:
    Focus object is added repeatedly, when focus is enabled.
    This patch checks existing focus object.
    
    Test Plan:
    elementary_test -to focus
    check/uncheck "Focus Highlight Enable" with spacebar
    
    Reviewers: Jaehyun_Cho, jpeg, cedric
    
    Reviewed By: cedric
    
    Differential Revision: https://phab.enlightenment.org/D3689
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/elm_win.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 900a0af..70f5392 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -2713,15 +2713,18 @@ _elm_win_focus_highlight_init(Elm_Win_Data *sd)
      }
 
    sd->focus_highlight.prev.target = NULL;
-   sd->focus_highlight.fobj = edje_object_add(sd->evas);
    sd->focus_highlight.theme_changed = EINA_TRUE;
+   if (!sd->focus_highlight.fobj)
+     {
+        sd->focus_highlight.fobj = edje_object_add(sd->evas);
+        edje_object_signal_callback_add(sd->focus_highlight.fobj,
+                                        "elm,action,focus,hide,end", "*",
+                                        _elm_win_focus_highlight_hide, NULL);
+        edje_object_signal_callback_add(sd->focus_highlight.fobj,
+                                        "elm,action,focus,anim,end", "*",
+                                        _elm_win_focus_highlight_anim_end, 
sd->obj);
+     }
 
-   edje_object_signal_callback_add(sd->focus_highlight.fobj,
-                                   "elm,action,focus,hide,end", "*",
-                                   _elm_win_focus_highlight_hide, NULL);
-   edje_object_signal_callback_add(sd->focus_highlight.fobj,
-                                   "elm,action,focus,anim,end", "*",
-                                   _elm_win_focus_highlight_anim_end, sd->obj);
    _elm_win_focus_highlight_reconfigure_job_start(sd);
 }
 

-- 


Reply via email to