discomfitor pushed a commit to branch enlightenment-0.19.

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

commit a372c31b8493b1f86c966654b2ef4a5cc973f045
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Sat Nov 7 13:08:12 2015 -0500

    add counter and smart callbacks for comp object visible mirrors
    
    ref T2788
---
 src/bin/e_comp_object.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index b83722a..6212a0e 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -97,6 +97,7 @@ typedef struct _E_Comp_Object
 
    unsigned int         animating;  // it's busy animating
    unsigned int         failures; //number of consecutive 
e_pixmap_image_draw() failures
+   unsigned int         force_visible; //number of visible obj_mirror objects
    Eina_Bool            delete_pending : 1;  // delete pendig
    Eina_Bool            defer_hide : 1;  // flag to get hide to work on 
deferred hide
    Eina_Bool            visible : 1;  // is visible
@@ -2062,6 +2063,26 @@ _e_comp_object_cb_mirror_del(void *data, Evas *e 
EINA_UNUSED, Evas_Object *obj,
 }
 
 static void
+_e_comp_object_cb_mirror_show(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+   E_Comp_Object *cw = data;
+
+   if ((!cw->force_visible) && (!e_object_is_del(E_OBJECT(cw->ec))))
+     evas_object_smart_callback_call(cw->smart_obj, "visibility_force", 
cw->ec);
+   cw->force_visible++;
+}
+
+static void
+_e_comp_object_cb_mirror_hide(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+   E_Comp_Object *cw = data;
+
+   cw->force_visible--;
+   if ((!cw->force_visible) && (!e_object_is_del(E_OBJECT(cw->ec))))
+     evas_object_smart_callback_call(cw->smart_obj, "visibility_normal", 
cw->ec);
+}
+
+static void
 _e_comp_smart_del(Evas_Object *obj)
 {
    Eina_List *l;
@@ -3536,6 +3557,8 @@ e_comp_object_util_mirror_add(Evas_Object *obj)
    evas_object_image_smooth_scale_set(o, e_comp_config_get()->smooth_windows);
    cw->obj_mirror = eina_list_append(cw->obj_mirror, o);
    evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, 
_e_comp_object_cb_mirror_del, cw);
+   evas_object_event_callback_add(o, EVAS_CALLBACK_SHOW, 
_e_comp_object_cb_mirror_show, cw);
+   evas_object_event_callback_add(o, EVAS_CALLBACK_HIDE, 
_e_comp_object_cb_mirror_hide, cw);
    evas_object_data_set(o, "E_Client", cw->ec);
    evas_object_data_set(o, "comp_mirror", cw);
 

-- 


Reply via email to