summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-09-10 16:43:35 -0300
committerRafael Antognolli <rafael.antognolli@intel.com>2013-09-10 16:43:35 -0300
commit24630e491a5bef740786805f93253a7d086f84b0 (patch)
treeb24a29478a6a3f0f9c5f793b42207e737ff37194
parent8c060968e7640d6b82f08db22c51be7ebc686e5e (diff)
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.
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_egl.c17
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_shm.c17
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 7614341e..46fcdb31 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
63{ 63{
64 Evas_Object *frame; 64 Evas_Object *frame;
65 Evas_Object *text; 65 Evas_Object *text;
66 Evas_Object *clipper;
66 Evas_Coord x, y, w, h; 67 Evas_Coord x, y, w, h;
67}; 68};
68 69
@@ -1147,9 +1148,15 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
1147 sd->w = 1; 1148 sd->w = 1;
1148 sd->h = 1; 1149 sd->h = 1;
1149 1150
1151 sd->clipper = evas_object_rectangle_add(evas);
1152 evas_object_color_set(sd->clipper, 255, 255, 255, 255);
1153 evas_object_smart_member_add(sd->clipper, obj);
1154
1150 sd->frame = evas_object_rectangle_add(evas); 1155 sd->frame = evas_object_rectangle_add(evas);
1151 evas_object_color_set(sd->frame, 249, 249, 249, 255); 1156 evas_object_color_set(sd->frame, 249, 249, 249, 255);
1152 evas_object_smart_member_add(sd->frame, obj); 1157 evas_object_smart_member_add(sd->frame, obj);
1158 evas_object_clip_set(sd->frame, sd->clipper);
1159 evas_object_show(sd->frame);
1153 1160
1154 sd->text = evas_object_text_add(evas); 1161 sd->text = evas_object_text_add(evas);
1155 evas_object_color_set(sd->text, 0, 0, 0, 255); 1162 evas_object_color_set(sd->text, 0, 0, 0, 255);
@@ -1157,6 +1164,8 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
1157 evas_object_text_font_set(sd->text, "Sans", 10); 1164 evas_object_text_font_set(sd->text, "Sans", 10);
1158 evas_object_text_text_set(sd->text, "Smart Test"); 1165 evas_object_text_text_set(sd->text, "Smart Test");
1159 evas_object_smart_member_add(sd->text, obj); 1166 evas_object_smart_member_add(sd->text, obj);
1167 evas_object_clip_set(sd->text, sd->clipper);
1168 evas_object_show(sd->text);
1160 1169
1161 evas_object_smart_data_set(obj, sd); 1170 evas_object_smart_data_set(obj, sd);
1162} 1171}
@@ -1171,6 +1180,7 @@ _ecore_evas_wl_smart_del(Evas_Object *obj)
1171 if (!(sd = evas_object_smart_data_get(obj))) return; 1180 if (!(sd = evas_object_smart_data_get(obj))) return;
1172 evas_object_del(sd->text); 1181 evas_object_del(sd->text);
1173 evas_object_del(sd->frame); 1182 evas_object_del(sd->frame);
1183 evas_object_del(sd->clipper);
1174 free(sd); 1184 free(sd);
1175} 1185}
1176 1186
@@ -1186,6 +1196,7 @@ _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
1186 sd->w = w; 1196 sd->w = w;
1187 sd->h = h; 1197 sd->h = h;
1188 evas_object_resize(sd->frame, w, h); 1198 evas_object_resize(sd->frame, w, h);
1199 evas_object_resize(sd->clipper, w, h);
1189} 1200}
1190 1201
1191static void 1202static void
@@ -1196,8 +1207,7 @@ _ecore_evas_wl_smart_show(Evas_Object *obj)
1196 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1207 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1197 1208
1198 if (!(sd = evas_object_smart_data_get(obj))) return; 1209 if (!(sd = evas_object_smart_data_get(obj))) return;
1199 evas_object_show(sd->frame); 1210 evas_object_show(sd->clipper);
1200 evas_object_show(sd->text);
1201} 1211}
1202 1212
1203static void 1213static void
@@ -1208,8 +1218,7 @@ _ecore_evas_wl_smart_hide(Evas_Object *obj)
1208 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1218 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1209 1219
1210 if (!(sd = evas_object_smart_data_get(obj))) return; 1220 if (!(sd = evas_object_smart_data_get(obj))) return;
1211 evas_object_hide(sd->text); 1221 evas_object_hide(sd->clipper);
1212 evas_object_hide(sd->frame);
1213} 1222}
1214 1223
1215static Evas_Object * 1224static 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 a8e01818..75ac0ea2 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
63{ 63{
64 Evas_Object *frame; 64 Evas_Object *frame;
65 Evas_Object *text; 65 Evas_Object *text;
66 Evas_Object *clipper;
66 Evas_Coord x, y, w, h; 67 Evas_Coord x, y, w, h;
67}; 68};
68 69
@@ -1350,9 +1351,15 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
1350 sd->w = 1; 1351 sd->w = 1;
1351 sd->h = 1; 1352 sd->h = 1;
1352 1353
1354 sd->clipper = evas_object_rectangle_add(evas);
1355 evas_object_color_set(sd->clipper, 255, 255, 255, 255);
1356 evas_object_smart_member_add(sd->clipper, obj);
1357
1353 sd->frame = evas_object_rectangle_add(evas); 1358 sd->frame = evas_object_rectangle_add(evas);
1354 evas_object_color_set(sd->frame, 249, 249, 249, 255); 1359 evas_object_color_set(sd->frame, 249, 249, 249, 255);
1355 evas_object_smart_member_add(sd->frame, obj); 1360 evas_object_smart_member_add(sd->frame, obj);
1361 evas_object_clip_set(sd->frame, sd->clipper);
1362 evas_object_show(sd->frame);
1356 1363
1357 sd->text = evas_object_text_add(evas); 1364 sd->text = evas_object_text_add(evas);
1358 evas_object_color_set(sd->text, 0, 0, 0, 255); 1365 evas_object_color_set(sd->text, 0, 0, 0, 255);
@@ -1360,6 +1367,8 @@ _ecore_evas_wl_smart_add(Evas_Object *obj)
1360 evas_object_text_font_set(sd->text, "Sans", 10); 1367 evas_object_text_font_set(sd->text, "Sans", 10);
1361 evas_object_text_text_set(sd->text, "Smart Test"); 1368 evas_object_text_text_set(sd->text, "Smart Test");
1362 evas_object_smart_member_add(sd->text, obj); 1369 evas_object_smart_member_add(sd->text, obj);
1370 evas_object_clip_set(sd->text, sd->clipper);
1371 evas_object_show(sd->text);
1363 1372
1364 evas_object_smart_data_set(obj, sd); 1373 evas_object_smart_data_set(obj, sd);
1365} 1374}
@@ -1374,6 +1383,7 @@ _ecore_evas_wl_smart_del(Evas_Object *obj)
1374 if (!(sd = evas_object_smart_data_get(obj))) return; 1383 if (!(sd = evas_object_smart_data_get(obj))) return;
1375 evas_object_del(sd->text); 1384 evas_object_del(sd->text);
1376 evas_object_del(sd->frame); 1385 evas_object_del(sd->frame);
1386 evas_object_del(sd->clipper);
1377 free(sd); 1387 free(sd);
1378} 1388}
1379 1389
@@ -1389,6 +1399,7 @@ _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
1389 sd->w = w; 1399 sd->w = w;
1390 sd->h = h; 1400 sd->h = h;
1391 evas_object_resize(sd->frame, w, h); 1401 evas_object_resize(sd->frame, w, h);
1402 evas_object_resize(sd->clipper, w, h);
1392} 1403}
1393 1404
1394static void 1405static void
@@ -1399,8 +1410,7 @@ _ecore_evas_wl_smart_show(Evas_Object *obj)
1399 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1410 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1400 1411
1401 if (!(sd = evas_object_smart_data_get(obj))) return; 1412 if (!(sd = evas_object_smart_data_get(obj))) return;
1402 evas_object_show(sd->frame); 1413 evas_object_show(sd->clipper);
1403 evas_object_show(sd->text);
1404} 1414}
1405 1415
1406static void 1416static void
@@ -1411,8 +1421,7 @@ _ecore_evas_wl_smart_hide(Evas_Object *obj)
1411 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1421 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1412 1422
1413 if (!(sd = evas_object_smart_data_get(obj))) return; 1423 if (!(sd = evas_object_smart_data_get(obj))) return;
1414 evas_object_hide(sd->text); 1424 evas_object_hide(sd->clipper);
1415 evas_object_hide(sd->frame);
1416} 1425}
1417 1426
1418static Evas_Object * 1427static Evas_Object *