Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_misc.c ewl_embed.c ewl_embed.h 


Log Message:
Abstract evas freeze/thaw into the embed.
This may be a bug in evas related to repeated calls to evas_event_freeze
followed by an equal number of evas_event_thaw. If only a single freeze/thaw
combination is used, objects are correctly positioned after redraw. When
multiple freeze/thaws are used, the UI appears to stop responding, but it is
actually not updating the interface on render.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_misc.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- ewl_misc.c  14 Jun 2006 15:47:01 -0000      1.58
+++ ewl_misc.c  21 Jun 2006 04:49:22 -0000      1.59
@@ -363,8 +363,7 @@
         */
        ecore_list_goto_first(ewl_embed_list);
        while ((emb = ecore_list_next(ewl_embed_list)) != NULL) {
-               if (REALIZED(emb) && emb->evas)
-                       evas_event_freeze(emb->evas);
+               ewl_embed_freeze(emb);
        }
 
        /*
@@ -424,7 +423,7 @@
                if (REALIZED(emb) && emb->evas) {
                        double render_time = 0;
 
-                       evas_event_thaw(emb->evas);
+                       ewl_embed_thaw(emb);
                        if (ewl_config.evas.render_debug) {
                                printf("Entering render\n");
                                render_time = ecore_time_get();
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- ewl_embed.c 20 Jun 2006 00:55:17 -0000      1.70
+++ ewl_embed.c 21 Jun 2006 04:49:22 -0000      1.71
@@ -1461,17 +1461,17 @@
 void
 ewl_embed_position_get(Ewl_Embed *e, int *x, int *y)
 {
-       int sx, sy;
+       int sx, sy;
 
-       DENTER_FUNCTION(DLEVEL_STABLE);
-       DCHECK_PARAM_PTR("e", e);
-       DCHECK_TYPE("e", e, EWL_EMBED_TYPE);
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("e", e);
+       DCHECK_TYPE("e", e, EWL_EMBED_TYPE);
 
-       evas_object_geometry_get(e->smart, &sx, &sy, NULL, NULL);
-       if (x) *x = e->x + sx;
-       if (y) *y = e->y + sy;
+       evas_object_geometry_get(e->smart, &sx, &sy, NULL, NULL);
+       if (x) *x = e->x + sx;
+       if (y) *y = e->y + sy;
 
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
 /**
@@ -1486,14 +1486,50 @@
 void
 ewl_embed_window_position_get(Ewl_Embed *e, int *x, int *y)
 {
-       DENTER_FUNCTION(DLEVEL_STABLE);
-       DCHECK_PARAM_PTR("e", e);
-       DCHECK_TYPE("e", e, EWL_EMBED_TYPE);
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("e", e);
+       DCHECK_TYPE("e", e, EWL_EMBED_TYPE);
 
-       if (x) *x = e->x;
-       if (y) *y = e->y;
+       if (x) *x = e->x;
+       if (y) *y = e->y;
 
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param e: the embed to freeze redraws and canvas events
+ * @return Returns no value.
+ * @brief Freeze redraws and events on the specified embed.
+ */
+void
+ewl_embed_freeze(Ewl_Embed *e)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("e", e);
+       DCHECK_TYPE("e", e, EWL_EMBED_TYPE);
+
+       if (REALIZED(e) && e->evas && evas_event_freeze_get(e->evas) < 1)
+               evas_event_freeze(e->evas);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param e: the embed to thaw redraws and canvas events
+ * @return Returns no value.
+ * @brief Thaw redraws and events on the specified embed.
+ */
+void
+ewl_embed_thaw(Ewl_Embed *e)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("e", e);
+       DCHECK_TYPE("e", e, EWL_EMBED_TYPE);
+
+       if (REALIZED(e) && e->evas && evas_event_freeze_get(e->evas) > 0)
+               evas_event_thaw(e->evas);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
 /**
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_embed.h 2 Jun 2006 21:56:51 -0000       1.19
+++ ewl_embed.h 21 Jun 2006 04:49:22 -0000      1.20
@@ -134,6 +134,8 @@
 void           ewl_embed_mouse_cursor_set(Ewl_Widget *w);
 void            ewl_embed_position_get(Ewl_Embed *e, int *x, int *y);
 void            ewl_embed_window_position_get(Ewl_Embed *e, int *x, int *y);
+void            ewl_embed_freeze(Ewl_Embed *e);
+void            ewl_embed_thaw(Ewl_Embed *e);
 
 /*
  * Internally used callbacks, override at your own risk.




_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to