forked from enlightenment/efl
Evas: Fix bugs in Wayland Engine(s) with regard to object geometry &
position. Fix bug when clipping to viewport/framespace. These changes fix Several buggers on Trac which related to the Wayland Engine(s). Fix minor bug in evas_render where clipping for framespace would not take into account the frame height and also move the frame clip to the values specified in framespace (not viewport). Fix buggers in evas_object_main which was causing objects (when created using the wayland engines) to be an incorrect size & position (objects will now be the same size/position in EFL Wayland as they are in X11). Fix evas_object_geometry_get to return values based on where they were moved (in relation to framespace). (These fixes are for the Wayland Engines and do not affect X11). Remove nw/nh from evas_object_resize (not needed variables anymore). SVN revision: 74565
This commit is contained in:
parent
ba567e440e
commit
72aad68b27
|
@ -595,11 +595,12 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||||
|
|
||||||
if (!obj->is_frame)
|
if (!obj->is_frame)
|
||||||
{
|
{
|
||||||
int fx, fy;
|
if ((!obj->smart.parent) && (obj->smart.smart))
|
||||||
|
|
||||||
evas_output_framespace_get(obj->layer->evas, &fx, &fy, NULL, NULL);
|
|
||||||
if (!obj->smart.parent)
|
|
||||||
{
|
{
|
||||||
|
int fx, fy;
|
||||||
|
|
||||||
|
evas_output_framespace_get(obj->layer->evas,
|
||||||
|
&fx, &fy, NULL, NULL);
|
||||||
nx += fx;
|
nx += fx;
|
||||||
ny += fy;
|
ny += fy;
|
||||||
}
|
}
|
||||||
|
@ -668,7 +669,6 @@ EAPI void
|
||||||
evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||||
{
|
{
|
||||||
int is, was = 0, pass = 0, freeze =0;
|
int is, was = 0, pass = 0, freeze =0;
|
||||||
int nw = 0, nh = 0;
|
|
||||||
|
|
||||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
return;
|
return;
|
||||||
|
@ -676,23 +676,7 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||||
if (obj->delete_me) return;
|
if (obj->delete_me) return;
|
||||||
if (w < 0) w = 0; if (h < 0) h = 0;
|
if (w < 0) w = 0; if (h < 0) h = 0;
|
||||||
|
|
||||||
nw = w;
|
if (evas_object_intercept_call_resize(obj, w, h)) return;
|
||||||
nh = h;
|
|
||||||
if (!obj->is_frame)
|
|
||||||
{
|
|
||||||
int fw, fh;
|
|
||||||
|
|
||||||
evas_output_framespace_get(obj->layer->evas, NULL, NULL, &fw, &fh);
|
|
||||||
if (!obj->smart.parent)
|
|
||||||
{
|
|
||||||
nw = w - fw;
|
|
||||||
nh = h - fh;
|
|
||||||
if (nw < 0) nw = 0;
|
|
||||||
if (nh < 0) nh = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (evas_object_intercept_call_resize(obj, nw, nh)) return;
|
|
||||||
|
|
||||||
if (obj->doing.in_resize > 0)
|
if (obj->doing.in_resize > 0)
|
||||||
{
|
{
|
||||||
|
@ -700,7 +684,7 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((obj->cur.geometry.w == nw) && (obj->cur.geometry.h == nh)) return;
|
if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return;
|
||||||
|
|
||||||
if (obj->layer->evas->events_frozen <= 0)
|
if (obj->layer->evas->events_frozen <= 0)
|
||||||
{
|
{
|
||||||
|
@ -716,11 +700,11 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||||
if (obj->smart.smart)
|
if (obj->smart.smart)
|
||||||
{
|
{
|
||||||
if (obj->smart.smart->smart_class->resize)
|
if (obj->smart.smart->smart_class->resize)
|
||||||
obj->smart.smart->smart_class->resize(obj, nw, nh);
|
obj->smart.smart->smart_class->resize(obj, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
obj->cur.geometry.w = nw;
|
obj->cur.geometry.w = w;
|
||||||
obj->cur.geometry.h = nh;
|
obj->cur.geometry.h = h;
|
||||||
|
|
||||||
evas_object_update_bounding_box(obj);
|
evas_object_update_bounding_box(obj);
|
||||||
|
|
||||||
|
@ -757,6 +741,8 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
||||||
{
|
{
|
||||||
|
int nx = 0, ny = 0;
|
||||||
|
|
||||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||||
if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
|
if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0;
|
||||||
return;
|
return;
|
||||||
|
@ -767,8 +753,30 @@ evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, E
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x) *x = obj->cur.geometry.x;
|
nx = obj->cur.geometry.x;
|
||||||
if (y) *y = obj->cur.geometry.y;
|
ny = obj->cur.geometry.y;
|
||||||
|
|
||||||
|
if (!obj->is_frame)
|
||||||
|
{
|
||||||
|
int fx, fy;
|
||||||
|
|
||||||
|
evas_output_framespace_get(obj->layer->evas,
|
||||||
|
&fx, &fy, NULL, NULL);
|
||||||
|
|
||||||
|
if ((!obj->smart.parent) && (obj->smart.smart))
|
||||||
|
{
|
||||||
|
if (nx > 0) nx -= fx;
|
||||||
|
if (ny > 0) ny -= fy;
|
||||||
|
}
|
||||||
|
else if ((obj->smart.parent) && (!obj->smart.smart))
|
||||||
|
{
|
||||||
|
if (nx > 0) nx -= fx;
|
||||||
|
if (ny > 0) ny -= fy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x) *x = nx;
|
||||||
|
if (y) *y = ny;
|
||||||
if (w) *w = obj->cur.geometry.w;
|
if (w) *w = obj->cur.geometry.w;
|
||||||
if (h) *h = obj->cur.geometry.h;
|
if (h) *h = obj->cur.geometry.h;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1352,6 +1352,8 @@ evas_render_updates_internal(Evas *e,
|
||||||
fy = e->viewport.y - e->framespace.y;
|
fy = e->viewport.y - e->framespace.y;
|
||||||
fw = e->viewport.w + e->framespace.w;
|
fw = e->viewport.w + e->framespace.w;
|
||||||
fh = e->viewport.h + e->framespace.h;
|
fh = e->viewport.h + e->framespace.h;
|
||||||
|
if (fx < 0) fx = 0;
|
||||||
|
if (fy < 0) fy = 0;
|
||||||
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
||||||
fx, fy, fw, fh);
|
fx, fy, fw, fh);
|
||||||
}
|
}
|
||||||
|
@ -1372,9 +1374,10 @@ evas_render_updates_internal(Evas *e,
|
||||||
e->framespace.clip = evas_object_rectangle_add(e);
|
e->framespace.clip = evas_object_rectangle_add(e);
|
||||||
evas_object_color_set(e->framespace.clip, 255, 255, 255, 255);
|
evas_object_color_set(e->framespace.clip, 255, 255, 255, 255);
|
||||||
evas_object_move(e->framespace.clip,
|
evas_object_move(e->framespace.clip,
|
||||||
e->framespace.x, e->viewport.y);
|
e->framespace.x, e->framespace.y);
|
||||||
evas_object_resize(e->framespace.clip,
|
evas_object_resize(e->framespace.clip,
|
||||||
e->viewport.w - e->framespace.w, e->viewport.h);
|
e->viewport.w - e->framespace.w,
|
||||||
|
e->viewport.h - e->framespace.h);
|
||||||
evas_object_show(e->framespace.clip);
|
evas_object_show(e->framespace.clip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1382,9 +1385,11 @@ evas_render_updates_internal(Evas *e,
|
||||||
/* master clip is already present. check for size changes in the
|
/* master clip is already present. check for size changes in the
|
||||||
* viewport, and update master clip size if needed */
|
* viewport, and update master clip size if needed */
|
||||||
if ((e->viewport.changed) || (e->output.changed))
|
if ((e->viewport.changed) || (e->output.changed))
|
||||||
evas_object_resize(e->framespace.clip,
|
{
|
||||||
e->viewport.w - e->framespace.w,
|
evas_object_resize(e->framespace.clip,
|
||||||
e->viewport.h);
|
e->viewport.w - e->framespace.w,
|
||||||
|
e->viewport.h - e->framespace.h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_RECTANGLE_SET(&clip_rect,
|
EINA_RECTANGLE_SET(&clip_rect,
|
||||||
|
|
Loading…
Reference in New Issue