antognolli pushed a commit to branch ecore-1.7.

commit 24630e491a5bef740786805f93253a7d086f84b0
Author: Rafael Antognolli <[email protected]>
Date:   Tue Sep 10 16:43:35 2013 -0300

    ecore_evas/wayland: Add a clipper to the frame object.
    
    The frame object is a simple smart object with two children: a rectangle
    (background) and a text (title). During the render phase, these objects
    get wrongly clipped to the client area clipper, because they have no
    clipper.
    
    This commit adds a clipper to the frame smart object, and clip the other
    children to it, so they won't get clipped to the client area clipper.
    
    It fix an old bug where there was a flickering behavior on the window
    decorations. The bug only happened on wayland_egl because of differences
    on how this backend handles dirty areas, but it could be a source of new
    bugs on wayland_shm too, so the solution is applied to both engines.
---
 src/lib/ecore_evas/ecore_evas_wayland_egl.c | 17 +++++++++++++----
 src/lib/ecore_evas/ecore_evas_wayland_shm.c | 17 +++++++++++++----
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/src/lib/ecore_evas/ecore_evas_wayland_egl.c 
b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
index 7614341..46fcdb3 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_egl.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
@@ -63,6 +63,7 @@ struct _EE_Wl_Smart_Data
 {
    Evas_Object *frame;
    Evas_Object *text;
+   Evas_Object *clipper;
    Evas_Coord x, y, w, h;
 };
 
@@ -1147,9 +1148,15 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
    sd->w = 1;
    sd->h = 1;
 
+   sd->clipper = evas_object_rectangle_add(evas);
+   evas_object_color_set(sd->clipper, 255, 255, 255, 255);
+   evas_object_smart_member_add(sd->clipper, obj);
+
    sd->frame = evas_object_rectangle_add(evas);
    evas_object_color_set(sd->frame, 249, 249, 249, 255);
    evas_object_smart_member_add(sd->frame, obj);
+   evas_object_clip_set(sd->frame, sd->clipper);
+   evas_object_show(sd->frame);
 
    sd->text = evas_object_text_add(evas);
    evas_object_color_set(sd->text, 0, 0, 0, 255);
@@ -1157,6 +1164,8 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
    evas_object_text_font_set(sd->text, "Sans", 10);
    evas_object_text_text_set(sd->text, "Smart Test");
    evas_object_smart_member_add(sd->text, obj);
+   evas_object_clip_set(sd->text, sd->clipper);
+   evas_object_show(sd->text);
 
    evas_object_smart_data_set(obj, sd);
 }
@@ -1171,6 +1180,7 @@ _ecore_evas_wl_smart_del(Evas_Object *obj)
    if (!(sd = evas_object_smart_data_get(obj))) return;
    evas_object_del(sd->text);
    evas_object_del(sd->frame);
+   evas_object_del(sd->clipper);
    free(sd);
 }
 
@@ -1186,6 +1196,7 @@ _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord 
w, Evas_Coord h)
    sd->w = w;
    sd->h = h;
    evas_object_resize(sd->frame, w, h);
+   evas_object_resize(sd->clipper, w, h);
 }
 
 static void 
@@ -1196,8 +1207,7 @@ _ecore_evas_wl_smart_show(Evas_Object *obj)
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (!(sd = evas_object_smart_data_get(obj))) return;
-   evas_object_show(sd->frame);
-   evas_object_show(sd->text);
+   evas_object_show(sd->clipper);
 }
 
 static void 
@@ -1208,8 +1218,7 @@ _ecore_evas_wl_smart_hide(Evas_Object *obj)
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (!(sd = evas_object_smart_data_get(obj))) return;
-   evas_object_hide(sd->text);
-   evas_object_hide(sd->frame);
+   evas_object_hide(sd->clipper);
 }
 
 static Evas_Object *
diff --git a/src/lib/ecore_evas/ecore_evas_wayland_shm.c 
b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
index a8e0181..75ac0ea 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_shm.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -63,6 +63,7 @@ struct _EE_Wl_Smart_Data
 {
    Evas_Object *frame;
    Evas_Object *text;
+   Evas_Object *clipper;
    Evas_Coord x, y, w, h;
 };
 
@@ -1350,9 +1351,15 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
    sd->w = 1;
    sd->h = 1;
 
+   sd->clipper = evas_object_rectangle_add(evas);
+   evas_object_color_set(sd->clipper, 255, 255, 255, 255);
+   evas_object_smart_member_add(sd->clipper, obj);
+
    sd->frame = evas_object_rectangle_add(evas);
    evas_object_color_set(sd->frame, 249, 249, 249, 255);
    evas_object_smart_member_add(sd->frame, obj);
+   evas_object_clip_set(sd->frame, sd->clipper);
+   evas_object_show(sd->frame);
 
    sd->text = evas_object_text_add(evas);
    evas_object_color_set(sd->text, 0, 0, 0, 255);
@@ -1360,6 +1367,8 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
    evas_object_text_font_set(sd->text, "Sans", 10);
    evas_object_text_text_set(sd->text, "Smart Test");
    evas_object_smart_member_add(sd->text, obj);
+   evas_object_clip_set(sd->text, sd->clipper);
+   evas_object_show(sd->text);
 
    evas_object_smart_data_set(obj, sd);
 }
@@ -1374,6 +1383,7 @@ _ecore_evas_wl_smart_del(Evas_Object *obj)
    if (!(sd = evas_object_smart_data_get(obj))) return;
    evas_object_del(sd->text);
    evas_object_del(sd->frame);
+   evas_object_del(sd->clipper);
    free(sd);
 }
 
@@ -1389,6 +1399,7 @@ _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord 
w, Evas_Coord h)
    sd->w = w;
    sd->h = h;
    evas_object_resize(sd->frame, w, h);
+   evas_object_resize(sd->clipper, w, h);
 }
 
 static void 
@@ -1399,8 +1410,7 @@ _ecore_evas_wl_smart_show(Evas_Object *obj)
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (!(sd = evas_object_smart_data_get(obj))) return;
-   evas_object_show(sd->frame);
-   evas_object_show(sd->text);
+   evas_object_show(sd->clipper);
 }
 
 static void 
@@ -1411,8 +1421,7 @@ _ecore_evas_wl_smart_hide(Evas_Object *obj)
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    if (!(sd = evas_object_smart_data_get(obj))) return;
-   evas_object_hide(sd->text);
-   evas_object_hide(sd->frame);
+   evas_object_hide(sd->clipper);
 }
 
 static Evas_Object *

-- 

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk

Reply via email to